Commit Graph

6 Commits

Author SHA1 Message Date
Hiroshi Miura
4e6fe665ab Black/PEP8
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-08-06 08:12:13 +09:00
David Dalcino
bc2945687c Rename autoused fixture more appropriately 2021-08-04 15:47:40 -07:00
David Dalcino
ec99247bad Monkeypatch multiprocessing.Manager 2021-08-04 15:47:10 -07:00
David Dalcino
e94ee842bb Allow platform-dependent path separators 2021-08-04 15:46:23 -07:00
David Dalcino
c95516ed8e Remove re.Pattern type hint
In Python 3.6, `re.Pattern` does not exist, and using it as a type hint
causes the tests to fail. This change enables the tests to run on
Python 3.6.
2021-08-04 15:43:56 -07:00
David Dalcino
66f1231444 Add 'tests/test_install.py'
This change adds unit tests for the `aqt install` and `aqt install-qt`
commands, and establishes a pattern that can be extended for more
tests. This is intended to make it easier to increase test coverage of
parts of the codebase that are not yet covered by tests.

This uses the `pytest-socket` library to ensure that the tests do not
use any network IO. It also mocks `multiprocessing.get_context` to
prevent multiprocessing. This is necessary because multiprocessing
spawns child processes that have not been monkey-patched, which would
break the test.

These tests use py7zr to create mock 7z archives, which are installed
and patched in a temporary directory. The tests check the content
of the patched files and any output to stderr.
2021-08-03 16:06:47 -07:00