Skip to content

Remove obsolete test code in runtests.py - #63

Merged
diazona merged 1 commit into
masterfrom
remove-runtests/1/dev
Jun 17, 2023
Merged

Remove obsolete test code in runtests.py#63
diazona merged 1 commit into
masterfrom
remove-runtests/1/dev

Conversation

@diazona

@diazona diazona commented Jun 12, 2023

Copy link
Copy Markdown
Contributor

The script runtests.py contains an archive of a very old version of pytest along with a custom mechanism to import it. That used to be the standard method of running tests (so I hear, anyway), but now it's no longer relevant because we use tox for dependency management in testing. So I'm removing the script. Having a large opaque blob of data is not the greatest thing :-)

For future reference, if anyone reading this wants to find out what's in that opaque blob, you can apply this patch and then run runtests.py, and it will write out the enclosed Python code into the directory runtests/ so you can read it.

diff --git a/runtests.py b/runtests.py
index a985c37..ed7792f 100644
--- a/runtests.py
+++ b/runtests.py
@@ -2708,9 +2708,9 @@ if __name__ == "__main__":
 
     sources = sources.encode("ascii")  # ensure bytes
     sources = pickle.loads(zlib.decompress(base64.decodebytes(sources)))
-
-    importer = DictImporter(sources)
-    sys.meta_path.insert(0, importer)
-
-    entry = "import py; raise SystemExit(py.test.cmdline.main())"
-    do_exec(entry, locals())  # noqa: F821
+    import pathlib
+    for k, v in sources.items():
+        path = pathlib.Path("runtests/" + k.replace(".", "/") + ".py")
+        path.parent.mkdir(parents=True, exist_ok=True)
+        with path.open("w") as f:
+            f.write(v)

The script runtests.py contains an archive of a very old version of
pytest along with a custom mechanism to import it. That used to be
the standard method of running tests (so I hear, anyway), but now it's
no longer relevant because we use tox for dependency management in
testing. So I'm removing the script. Having a large opaque blob of data
is not the greatest thing :-)
@diazona diazona added this to the v0.8.0 milestone Jun 12, 2023
@diazona
diazona requested review from coordt and redtoad June 12, 2023 08:03
@diazona
diazona merged commit 7b6de78 into master Jun 17, 2023
@diazona
diazona deleted the remove-runtests/1/dev branch June 17, 2023 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant