From 1c03d136412f4d99f006c946985bfd8e7c28c8f8 Mon Sep 17 00:00:00 2001 From: Evan Kiefl Date: Sat, 24 Aug 2024 16:20:55 -0700 Subject: [PATCH 1/2] Move tests to tests/, not working --- pyproject.toml | 2 +- {pooltool => tests}/events/test_filter.py | 0 {pooltool => tests}/events/test_resolve.py | 0 .../evolution/event_based/test_data/__init__.py | 0 .../evolution/event_based/test_data/case1.msgpack | Bin .../evolution/event_based/test_data/case2.msgpack | Bin .../evolution/event_based/test_data/case3.msgpack | Bin .../evolution/event_based/test_data/case4.msgpack | Bin .../evolution/event_based/test_simulate.py | 0 {pooltool => tests}/evolution/test_continuize.py | 0 {pooltool => tests}/objects/ball/test_datatypes.py | 0 {pooltool => tests}/objects/cue/test_datatypes.py | 0 .../objects/table/test_components.py | 0 {pooltool => tests}/objects/table/test_datatypes.py | 0 .../resolve/ball_cushion/test_ball_cushion.py | 0 {pooltool => tests}/physics/test_engine.py | 0 {pooltool => tests}/ptmath/roots/test_quartic.py | 0 {pooltool => tests}/ptmath/test_ptmath.py | 0 {pooltool => tests}/serialize/test_serialize.py | 0 {pooltool => tests}/test_layouts.py | 0 20 files changed, 1 insertion(+), 1 deletion(-) rename {pooltool => tests}/events/test_filter.py (100%) rename {pooltool => tests}/events/test_resolve.py (100%) rename {pooltool => tests}/evolution/event_based/test_data/__init__.py (100%) rename {pooltool => tests}/evolution/event_based/test_data/case1.msgpack (100%) rename {pooltool => tests}/evolution/event_based/test_data/case2.msgpack (100%) rename {pooltool => tests}/evolution/event_based/test_data/case3.msgpack (100%) rename {pooltool => tests}/evolution/event_based/test_data/case4.msgpack (100%) rename {pooltool => tests}/evolution/event_based/test_simulate.py (100%) rename {pooltool => tests}/evolution/test_continuize.py (100%) rename {pooltool => tests}/objects/ball/test_datatypes.py (100%) rename {pooltool => tests}/objects/cue/test_datatypes.py (100%) rename {pooltool => tests}/objects/table/test_components.py (100%) rename {pooltool => tests}/objects/table/test_datatypes.py (100%) rename {pooltool => tests}/physics/resolve/ball_cushion/test_ball_cushion.py (100%) rename {pooltool => tests}/physics/test_engine.py (100%) rename {pooltool => tests}/ptmath/roots/test_quartic.py (100%) rename {pooltool => tests}/ptmath/test_ptmath.py (100%) rename {pooltool => tests}/serialize/test_serialize.py (100%) rename {pooltool => tests}/test_layouts.py (100%) diff --git a/pyproject.toml b/pyproject.toml index 1a5373ca..a88adda0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -136,7 +136,7 @@ extend-select = ["I"] [tool.pytest.ini_options] testpaths = [ - "pooltool", + "tests", ] # [tool.pyright] diff --git a/pooltool/events/test_filter.py b/tests/events/test_filter.py similarity index 100% rename from pooltool/events/test_filter.py rename to tests/events/test_filter.py diff --git a/pooltool/events/test_resolve.py b/tests/events/test_resolve.py similarity index 100% rename from pooltool/events/test_resolve.py rename to tests/events/test_resolve.py diff --git a/pooltool/evolution/event_based/test_data/__init__.py b/tests/evolution/event_based/test_data/__init__.py similarity index 100% rename from pooltool/evolution/event_based/test_data/__init__.py rename to tests/evolution/event_based/test_data/__init__.py diff --git a/pooltool/evolution/event_based/test_data/case1.msgpack b/tests/evolution/event_based/test_data/case1.msgpack similarity index 100% rename from pooltool/evolution/event_based/test_data/case1.msgpack rename to tests/evolution/event_based/test_data/case1.msgpack diff --git a/pooltool/evolution/event_based/test_data/case2.msgpack b/tests/evolution/event_based/test_data/case2.msgpack similarity index 100% rename from pooltool/evolution/event_based/test_data/case2.msgpack rename to tests/evolution/event_based/test_data/case2.msgpack diff --git a/pooltool/evolution/event_based/test_data/case3.msgpack b/tests/evolution/event_based/test_data/case3.msgpack similarity index 100% rename from pooltool/evolution/event_based/test_data/case3.msgpack rename to tests/evolution/event_based/test_data/case3.msgpack diff --git a/pooltool/evolution/event_based/test_data/case4.msgpack b/tests/evolution/event_based/test_data/case4.msgpack similarity index 100% rename from pooltool/evolution/event_based/test_data/case4.msgpack rename to tests/evolution/event_based/test_data/case4.msgpack diff --git a/pooltool/evolution/event_based/test_simulate.py b/tests/evolution/event_based/test_simulate.py similarity index 100% rename from pooltool/evolution/event_based/test_simulate.py rename to tests/evolution/event_based/test_simulate.py diff --git a/pooltool/evolution/test_continuize.py b/tests/evolution/test_continuize.py similarity index 100% rename from pooltool/evolution/test_continuize.py rename to tests/evolution/test_continuize.py diff --git a/pooltool/objects/ball/test_datatypes.py b/tests/objects/ball/test_datatypes.py similarity index 100% rename from pooltool/objects/ball/test_datatypes.py rename to tests/objects/ball/test_datatypes.py diff --git a/pooltool/objects/cue/test_datatypes.py b/tests/objects/cue/test_datatypes.py similarity index 100% rename from pooltool/objects/cue/test_datatypes.py rename to tests/objects/cue/test_datatypes.py diff --git a/pooltool/objects/table/test_components.py b/tests/objects/table/test_components.py similarity index 100% rename from pooltool/objects/table/test_components.py rename to tests/objects/table/test_components.py diff --git a/pooltool/objects/table/test_datatypes.py b/tests/objects/table/test_datatypes.py similarity index 100% rename from pooltool/objects/table/test_datatypes.py rename to tests/objects/table/test_datatypes.py diff --git a/pooltool/physics/resolve/ball_cushion/test_ball_cushion.py b/tests/physics/resolve/ball_cushion/test_ball_cushion.py similarity index 100% rename from pooltool/physics/resolve/ball_cushion/test_ball_cushion.py rename to tests/physics/resolve/ball_cushion/test_ball_cushion.py diff --git a/pooltool/physics/test_engine.py b/tests/physics/test_engine.py similarity index 100% rename from pooltool/physics/test_engine.py rename to tests/physics/test_engine.py diff --git a/pooltool/ptmath/roots/test_quartic.py b/tests/ptmath/roots/test_quartic.py similarity index 100% rename from pooltool/ptmath/roots/test_quartic.py rename to tests/ptmath/roots/test_quartic.py diff --git a/pooltool/ptmath/test_ptmath.py b/tests/ptmath/test_ptmath.py similarity index 100% rename from pooltool/ptmath/test_ptmath.py rename to tests/ptmath/test_ptmath.py diff --git a/pooltool/serialize/test_serialize.py b/tests/serialize/test_serialize.py similarity index 100% rename from pooltool/serialize/test_serialize.py rename to tests/serialize/test_serialize.py diff --git a/pooltool/test_layouts.py b/tests/test_layouts.py similarity index 100% rename from pooltool/test_layouts.py rename to tests/test_layouts.py From 85c99d52e073c9f17111d8edba1ef212acd3f0b1 Mon Sep 17 00:00:00 2001 From: Evan Kiefl Date: Sat, 24 Aug 2024 16:30:13 -0700 Subject: [PATCH 2/2] Finalize tests --- pyproject.toml | 3 +++ tests/evolution/event_based/test_simulate.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a88adda0..112b4fa2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -135,6 +135,9 @@ line-length = 88 extend-select = ["I"] [tool.pytest.ini_options] +addopts = [ + "--import-mode=importlib", +] testpaths = [ "tests", ] diff --git a/tests/evolution/event_based/test_simulate.py b/tests/evolution/event_based/test_simulate.py index 20f50587..dffe3238 100644 --- a/tests/evolution/event_based/test_simulate.py +++ b/tests/evolution/event_based/test_simulate.py @@ -12,10 +12,10 @@ simulate, ) from pooltool.evolution.event_based.solve import ball_ball_collision_coeffs -from pooltool.evolution.event_based.test_data import TEST_DIR from pooltool.objects import Ball, BilliardTableSpecs, Cue, Table from pooltool.ptmath.roots import quadratic, quartic from pooltool.system import System +from tests.evolution.event_based.test_data import TEST_DIR def test_simulate_inplace():