Commit Graph

13 Commits

Author SHA1 Message Date
iakov
cc7be3dc29 Make prefix optional
Co-authored-by: David Dalcino <ddalcino@users.noreply.github.com>
2023-02-03 20:08:03 +03:00
iakov
bc10ba9e85 Pin EMSDK version for build where useful
Also fix test that fails at the moment
2023-02-03 12:06:03 +03:00
David Dalcino
d5213142a8 Fix misuse of disable_socket (#415)
In an earlier PR, I added calls to `disable_socket()` from
`pytest_socket` where I thought they were needed to prevent some tests
from accessing the network, in case they weren't monkeypatched properly.
Today, I discovered that `disable_socket()` disables sockets globally
for all tests, which means that the tests that use remote data cannot
run if they are executed after another test calls `disable_socket()`.

This change calls `disable_socket()` once from `conftest.py`, so that
no tests are allowed to use network data unless they are marked as ok
to use the network, with `@pytest.mark.enable_socket`. See example of
usage in `tests/test_connection.py`.

Changed return code for unexpected exceptions:

This allows us to write tests that can discover whether an unexpected
exception occurred just by checking the return code, rather than reading
stderr. This will allow us to write less friable tests that don't break
every time some insignificant output details change.

This change catches exceptions derived from Exception and
KeyboardInterrupt raised by `installer`, while run by multiple
processes, and propagates them back to earlier stack entries. This will
prevent any OSError and BrokenPipe exceptions that would otherwise be
raised when one process has an exception while the other processes are
still running.

This also handles the MemoryError exception we saw in #416, and offers
some suggestions for solving the issue.
2021-10-05 14:40:05 +09:00
David Dalcino
a5bb2553ce Add improved error messages for missing archives 2021-09-20 12:46:47 -07:00
David Dalcino
cfd4234877 Expect Cli.run not to exit on connection errors 2021-09-01 12:36:29 -07:00
David Dalcino
9982f56613 Fix syntax of new subcommands in tests 2021-08-01 13:25:05 -07:00
David Dalcino
b09e7f1293 Fix test_connection.py (again ... oops)
Sorry, when I changed the error message in #292, I forgot to change the corresponding test code that checks it!
2021-07-01 17:12:49 -07:00
David Dalcino
5eacfb03a4 remove whitespace from blank line 2021-07-01 12:17:41 -07:00
David Dalcino
114f6e5755 Fix test_cli_unknown_version
The test test_cli_unknown_version, in `tests/test_connection.py`, is
never run in CI because it is marked as requiring remote data. When I
run `pytest` locally, this test always fails because the version string
"5.12" cannot be parsed into a valid `semantic_version.Version` object.
This change modifies that version string to "5.16.0", so that it will
make a valid Version object that will never be a valid version of Qt.

This also modifies the assertion code in test_cli_unknown_version.
On my machine, the new logger prints directly to `stderr` and not
`stdout` when run via `pytest`, and the `aqt - WARNING` and `aqt -ERROR`
prefixes are omitted. The new assertion code uses a regex to pick out
the required parts of the output and ignore anything that might not show
up.

This change also accounts for what happens during a redirect. In my
testing, I noticed that redirects would occasionally insert some
additional lines of output regarding a redirect. This change describes
this output in a comment, and swallows up the additional lines using a
Kleene star.
2021-07-01 11:15:58 -07:00
Hiroshi Miura
d841741641 Reformat by black
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-04-02 12:20:10 +09:00
Hiroshi Miura
efe2501cb4 Test: update to catch refactoring
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2020-11-22 09:55:44 +09:00
Hiroshi Miura
c773fbda15 CLI: Change version info and test excpectation (#107)
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2020-03-05 23:01:14 +09:00
Hiroshi Miura
79b5a297b5 Check version number and improve error messages (#102)
* Check Qt versions and report 404 error

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2020-03-01 11:35:39 +09:00