core/ci: fix windows-specific issues

- use portable separators
- paths should be prepended with r' (so backwards slash isn't treated as escaping)
- sqlite connections should be closed (otherwise windows fails to remove the underlying db file)
- workaround for emojis via PYTHONUTF8=1 test for now
- make ZipPath portable
- properly use tox python environment everywhere

  this was causing issues on Windows
  e.g.
      WARNING: test command found but not installed in testenv
        cmd: C:\hostedtoolcache\windows\Python\3.9.12\x64\python3.EXE
This commit is contained in:
Dima Gerasimov 2022-05-02 18:26:22 +01:00
parent 960ed56291
commit e774f974f8
11 changed files with 67 additions and 37 deletions

View file

@ -229,9 +229,9 @@ def test_bad_modules(tmp_path: Path) -> None:
(par / 'malicious.py').write_text(f'''
from pathlib import Path
Path('{xx}').write_text('aaand your data is gone!')
Path(r'{xx}').write_text('aaand your data is gone!')
raise RuntimeError("FAIL ON IMPORT! naughy.")
raise RuntimeError("FAIL ON IMPORT! naughty.")
def stats():
return [1, 2, 3]