Commit Graph
14 Commits
Author SHA1 Message Date
Nicola Soranzo dcb6f061f6 Don't install Galaxy packages in editable mode when testing them
When enabling the `warn_unused_ignores = True` option of mypy, this
was making the `test_galaxy_packages` tests fail with:

```
mypy .
Traceback (most recent call last):
  File "/tmp/gxpkgtestenvu3fgDr/bin/mypy", line 8, in <module>
    sys.exit(console_entry())
  File "/tmp/gxpkgtestenvu3fgDr/lib/python3.10/site-packages/mypy/__main__.py", line 15, in console_entry
    main()
  File "mypy/main.py", line 100, in main
  File "mypy/main.py", line 182, in run_build
  File "mypy/build.py", line 192, in build
  File "mypy/build.py", line 266, in _build
  File "mypy/build.py", line 2942, in dispatch
  File "mypy/build.py", line 3333, in process_graph
  File "mypy/build.py", line 3414, in process_fresh_modules
  File "mypy/build.py", line 2110, in fix_cross_refs
  File "mypy/fixup.py", line 52, in fixup_module
  File "mypy/fixup.py", line 127, in visit_symbol_table
  File "mypy/lookup.py", line 49, in lookup_fully_qualified
AssertionError: Cannot find component 'util' for 'galaxy.util'
make: *** [Makefile:96: mypy] Error 1
```

Moreover, installing packages in editable mode was hiding some issues
with how files from other packages were accessed.
2024-04-16 01:12:57 +01:00
John Davis dacc38698b Add utility function for enum member values + test 2023-04-13 18:53:44 -04:00
Nicola Soranzo c5868cc717 Add overloads to `listify()` type annotations
Also:
- Add unit tests.
2022-11-28 04:50:03 +00:00
John Davis 3b488017b1 Normalize path before checking basename 2022-11-21 18:12:04 -05:00
John Davis b2d6b8d40d Skip dbscript tests if running from packages; refactor util function 2022-11-21 18:12:04 -05:00
Dannon Baker 623a5e165a Apply black formatting.
Apply isort.
2022-02-03 07:42:20 -05:00
mvdbeek 8f300a5289 Move doctest to unittest 2021-11-19 13:20:06 +01:00
John Chilton 8f9034a414 Typing fixes for various unit tests. 2021-10-05 13:22:41 -04:00
mvdbeek c389a2ca44 Also create deepcopy of objects passed into safe_loads
It's not used in many places, this shouldn't have much impact on
performance, and I guess it's a fair assumption that something called
json.safe_loads would return a deepcopy. That's complementary to the
previous commit and would also separately fix the issues referenced
there.
2021-06-14 18:43:47 +02:00
mvdbeek 029c017c69 Drop strip_control_characters_nested workaround
Pretty sure https://github.com/galaxyproject/galaxy/pull/10390/ fixed
the null issue to start with.
2021-02-05 13:13:23 +01:00
mvdbeek ccdb6c3f10 Replace usage of mkstemp with NamedTemporaryFile 2020-12-07 22:31:53 +01:00
John Chilton 22ddea4337 Better packaging of unit test utilities.
clean_multiline_string was used in multiple places across modules in different packages so I simply refactored it into galaxy.util and added a test case (used in multiple places and has tests a lower bar then some other code in galaxy.util).

The tempfilecache abstraction was only used in one place, so I've refactored it right into that file.

Together these should simplify the package tests for galaxy-data (and hopefully other packages also).
2020-07-03 13:32:32 -04:00
mvdbeek 0a8634b2f7 Add missing errno to exception raised by lxml for missing file 2020-05-12 22:19:06 +02:00
Sergey Golitsynskiy ec74687d12 Refactor reading config properties from a file 2019-08-14 19:11:04 -04:00