summaryrefslogtreecommitdiff
path: root/tests/utilities.py
Commit message (Collapse)AuthorAge
* Fix compatibility with Python 3.8Felix Yan2019-11-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The error handling code needs tearDown_exceptions in the new version of Python. Otherwise the following error appears: ``` Traceback (most recent call last): File "setup.py", line 7, in <module> setup( File "/usr/lib/python3.8/site-packages/setuptools/__init__.py", line 145, in setup return distutils.core.setup(**attrs) File "/usr/lib/python3.8/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/lib/python3.8/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/usr/lib/python3.8/site-packages/setuptools/command/test.py", line 229, in run self.run_tests() File "/usr/lib/python3.8/site-packages/setuptools/command/test.py", line 247, in run_tests test = unittest.main( File "/usr/lib/python3.8/unittest/main.py", line 101, in __init__ self.runTests() File "/usr/lib/python3.8/unittest/main.py", line 271, in runTests self.result = testRunner.run(self.test) File "/usr/lib/python3.8/unittest/runner.py", line 176, in run test(result) File "/usr/lib/python3.8/unittest/suite.py", line 84, in __call__ return self.run(*args, **kwds) File "/usr/lib/python3.8/unittest/suite.py", line 122, in run test(result) File "/usr/lib/python3.8/unittest/suite.py", line 84, in __call__ return self.run(*args, **kwds) File "/usr/lib/python3.8/unittest/suite.py", line 122, in run test(result) File "/usr/lib/python3.8/unittest/suite.py", line 84, in __call__ return self.run(*args, **kwds) File "/usr/lib/python3.8/unittest/suite.py", line 122, in run test(result) File "/usr/lib/python3.8/unittest/suite.py", line 84, in __call__ return self.run(*args, **kwds) File "/usr/lib/python3.8/unittest/suite.py", line 122, in run test(result) File "/usr/lib/python3.8/unittest/suite.py", line 84, in __call__ return self.run(*args, **kwds) File "/usr/lib/python3.8/unittest/suite.py", line 112, in run self._tearDownPreviousClass(test, result) File "/usr/lib/python3.8/unittest/suite.py", line 301, in _tearDownPreviousClass if len(previousClass.tearDown_exceptions) > 0: AttributeError: type object 'TestSettingsManagerGetAccountByAddress' has no attribute 'tearDown_exceptions' ```
* Remove unicode literals syntax from python2Lucas Hoffmann2019-11-06
|
* Use unittest.mock from the stdlibLucas Hoffmann2019-08-15
| | | | It was added to the stdlib in py3.3 and we already require 3.5.
* tests: drop remaining references to twisted from unit testsDylan Baker2018-07-26
| | | | all unittests now use asyncio and the standard unittest framework.
* utilities: Add a decorator for asyncio testsDylan Baker2018-07-26
| | | | | This decorator works to allow tests for pure asyncio coroutines to operate synchronously.
* Remove old __future__ importsLucas Hoffmann2018-06-19
| | | | They are not needed for python >= 3.0.
* Move screen stop/start logic into context manager.Thomas Nixon2018-02-19
| | | | | | | As well as reducing duplication and adding screen size detection to :pipeto and :pyshell, this ensures that the screen is always restarted, resulting in cleaner error handling if an error occurs while the screen is stopped.
* Move mock ui creation to function.Thomas Nixon2018-02-19
|
* tests/utilities: Add expected_failure decorator for twisted.trial testsDylan Baker2017-08-22
| | | | | | | | | Twisted.trail.unittest doesn't provide an expectedFailure decorator, nor does it work with the one from the builtin library. Instead it relies on having a "todo" attribute set. This new utilities decorator simply sets that attribute to a string value (booleans don't work).
* convert from pygpgme to the python "gpg" moduleDaniel Kahn Gillmor2017-08-14
| | | | | | | | | | | | | | | This converts from the now abandoned pygpgme project for wrapping gpgme, to the upstream gpgme python bindings (which are descended from the pyme project, before they became official). Largely this change should not be user visible, but there are a couple cases where the new bindings provide slightly more detailed error messages, and alot directly presents those messages to users. This patch has been significantly revised and updated by Dylan Baker, but was originally authored by Daniel Kahn Gillmor. Fixes #1069
* tests/utilities: Allow uid to be passed to make_uidDylan Baker2017-07-24
|
* tests/utilities: have make_key rely on make_uidDylan Baker2017-07-24
|
* tests: move shared helpers out of crypto module into common moduleDylan Baker2017-07-24
|
* tests/crypto: Add tests for the crypto moduleDylan Baker2017-07-15
| | | | | | This covers mosts of the functions in the crypto module, but doesn't bother with the hash_key function, which is slated for deletion in the port to python-gpg. It also doesn't cover re-raising errors.
* tests: Add a module with some extra utility helpersDylan Baker2017-07-11
This module currently only contains a class that adds a class level addCleanup function (called addClassCleanup).