Skip to content

Commit

Permalink
Crash Test Dummies
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielfalcao committed Dec 31, 2023
1 parent 74ebb94 commit c262577
Show file tree
Hide file tree
Showing 33 changed files with 1,183 additions and 866 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ jobs:
strategy:
matrix:
python:
- "3.9"
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.6"
- "3.8"
# IMPORTANT: update the documentation file ../../docs/source/getting-started.rst when adding more python versions to the list above

steps:
- uses: actions/checkout@v3
Expand Down
98 changes: 2 additions & 96 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,97 +1,3 @@
# Change Log
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
# Changelog


## [v3.0.0]

- Presents better documentation
- Drops support to Python 2
- Introduces the modules ``sure.doubles``, ``sure.doubles.fakes`` and ``sure.doubles.stubs``
- Moves the class ``sure.compat.FakeOrderedDict`` into the module ``sure.doubles.fakes``
- Sure's featured synctactic-sugar of injecting/monkey-patching
``.should``, ``.should_not``, et cetera methods into
:py:class:`object` and its subclasses is disabled by default and needs to be enabled explicitly, programmatically via ``sure.enable_special_syntax()`` or via command-line with the flags: ``-s`` or ``--special-syntax``

## [v2.0.0]
### Fixed
- No longer patch the builtin `dir()` function, which fixes pytest in some cases such as projects using gevent.

## [v1.4.11]
### Fixed
- Reading the version dinamically was causing import errors that caused error when installing package. Refs #144

## [v1.4.7]
### Fixed
- Remove wrong parens for format call. Refs #139

## [v1.4.6]
### Added
- Support and test against PyPy 3

### Fixed
- Fix safe representation in exception messages for bytes and unicode objects. Refs #136

## [v1.4.5]
### Fixed
- Correctly escape special character for `str.format()` for assertion messages. Refs #134

## [v1.4.4]

*Nothing to mention here.*

## [v1.4.3]
### Fixed
- Bug in setup.py that would break in python > 2

## [v1.4.2]
### Added
- `ensure` context manager to provide custom assertion messages. Refs #125

## [v1.4.1]
### Added
- Python 3.6 support
- Python 3.7-dev support (allowed to fail)

### Fixed
- Do not overwrite existing class and instance attributes with sure properties (when. should, ...). Refs #127, #129
- Fix patched built-in `dir()` method. Refs #124, #128

## [v1.4.0]
### Added
- anything object which is accessible with `sure.anything`
- interface to extend sure. Refs #31

### Removed
- Last traces of Python 2.6 support

### Fixed
- Allow overwriting of monkey-patched properties by sure. Refs #19
- Assertions for raises

## [v1.3.0]
### Added
- Python 3.3, 3.4 and 3.5 support
- pypy support
- Support comparison of OrderedDict. Refs #55

### Fixed
- `contain` assertion. Refs #104


## No previous changelog history.

Please see `git log`

[Unreleased]: https://github.com/gabrielfalcao/sure/compare/v1.4.7...HEAD
[v1.4.7]: https://github.com/gabrielfalcao/sure/compare/1.4.6...v1.4.7
[v1.4.6]: https://github.com/gabrielfalcao/sure/compare/1.4.5...v1.4.6
[v1.4.5]: https://github.com/gabrielfalcao/sure/compare/1.4.4...v1.4.5
[v1.4.4]: https://github.com/gabrielfalcao/sure/compare/1.4.3...v1.4.4
[v1.4.3]: https://github.com/gabrielfalcao/sure/compare/1.4.2...v1.4.3
[v1.4.2]: https://github.com/gabrielfalcao/sure/compare/1.4.1...v1.4.2
[v1.4.1]: https://github.com/gabrielfalcao/sure/compare/1.4.0...v1.4.1
[v1.4.0]: https://github.com/gabrielfalcao/sure/compare/1.3.0...v1.4.0
[v1.3.0]: https://github.com/gabrielfalcao/sure/compare/1.2.9...v1.3.0
[1.2.9]: https://github.com/gabrielfalcao/sure/compare/1.2.5...1.2.9
[1.2.5]: https://github.com/gabrielfalcao/sure/compare/1.2.4...1.2.5
The changelog of the Sure project has been moved to the documentation page: [https://sure.readthedocs.io](https://sure.readthedocs.io)
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ test tests: clean | $(VENV)/bin/pytest # $(VENV)/bin/nosetests # @$(VENV)/bin/no

# run main command-line tool
run: | $(MAIN_CLI_PATH)
$(MAIN_CLI_PATH) --reporter=test tests/crashes || true
$(MAIN_CLI_PATH) --special-syntax --with-coverage --cover-branches --cover-module=sure.core --cover-module=sure tests/runner

# Pushes release of this package to pypi
Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ BUILDDIR = build

# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from https://sphinx-doc.org/)
endif

# Internal variables.
Expand Down
19 changes: 0 additions & 19 deletions docs/source/about.rst

This file was deleted.

39 changes: 9 additions & 30 deletions docs/source/api-reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,50 +7,32 @@ API Reference
--------

.. automodule:: sure

.. autofunction:: sure.enable_special_syntax

.. autoclass:: sure.VariablesBag

.. autoclass:: sure.CallBack

.. autofunction:: sure.that_with_context

.. autofunction:: sure.within

.. autofunction:: sure.word_to_number

.. autofunction:: sure.assertionmethod

.. autofunction:: sure.assertionproperty

.. autoclass:: sure.IdentityAssertion

.. autoclass:: sure.AssertionBuilder

.. autofunction:: sure.assertion

.. autofunction:: sure.chain

.. autofunction:: sure.chainproperty

.. autoclass:: sure.ensure



``sure.core``
-------------

.. py:module:: sure.core
.. automodule:: sure.core
.. autoclass:: sure.core.DeepExplanation

.. _deep comparison:
.. autoclass:: sure.core.DeepComparison

.. autofunction:: sure.core._get_file_name

.. autofunction:: sure.core._get_line_number

.. autofunction:: sure.core.itemize_length


Expand Down Expand Up @@ -99,38 +81,35 @@ API Reference
``sure.original``
-----------------

.. py:module:: sure.original
.. automodule:: sure.original
.. autofunction:: sure.original.identify_callable_location

.. autofunction:: sure.original.is_iterable

.. autofunction:: sure.original.all_integers

.. autofunction:: sure.original.explanation


``sure.doubles``
----------------

.. automodule:: sure.doubles

.. autofunction:: sure.doubles.stub

.. autoclass:: sure.doubles.FakeOrderedDict
.. autoattribute:: sure.doubles.anything

``sure.doubles.dummies``
------------------------

.. autoclass:: sure.doubles.dummies.Anything
.. autoattribute:: sure.doubles.dummies.anything

``sure.doubles.fakes``
----------------------

.. automodule:: sure.doubles.fakes

.. autoclass:: sure.doubles.fakes.FakeOrderedDict


``sure.doubles.stubs``
----------------------

.. automodule:: sure.doubles.stubs

.. autoclass:: sure.doubles.stubs.stub

0 comments on commit c262577

Please sign in to comment.