Repository: OpenFreeEnergy/konnektor
Pull request #125: Move fixtures to conftest
Author: login: atravitz
Created: 2025-03-11T17:00:10Z | Merged: 2025-03-12T15:09:39Z

<!--
Thank you for pull request.
Below are a few things we ask you kindly to self-check before getting a review. Remove checks that are not relevant.
-->
This moves us to a more standard pytest usage, and allows us to add in ruff rules to detect unused imports.

<!--
Please note any issues this fixes using [closing keywords]( https://help.github.com/articles/closing-issues-using-keywords/ ):
-->

## PR Author Checklist
- [x] add news item if changes are user-facing
- [ ] run `pre-commit.ci autofix` when the PR is ready for review

## Tips
* Comment "pre-commit.ci autofix" to have pre-commit.ci auto-format your PR.
  Since this will create a commit, it is best to make this comment when you are finished with your work.

## Developers certificate of origin
- [x] I certify that this contribution is covered by the MIT License [here](https://github.com/OpenFreeEnergy/openfe/blob/main/LICENSE) and the **Developer Certificate of Origin** at <https://developercertificate.org/>.


## Reviewer Checklist
- [ ] news entry has been added if necessary
- [ ] pre-commit auto fix has been run
- [ ] any API breaks have been documented



Diff:
diff --git a/.ruff.toml b/.ruff.toml
index ff099cef..f22ff530 100644
--- a/.ruff.toml
+++ b/.ruff.toml
@@ -45,8 +45,6 @@ select = [
     "UP",
 ]
 ignore = [
-    "F401",  # unused import - (TODO: fix this when refactoring tests)
-    "F811",  # redefinition (TODO: fix this when refactoring tests)
     "E402",   # module-level import not at top (conflicts w/ isort)
     "E501",  # line-length violations (black enforces these)
     "E731",  # lambda expressions (TODO: we should fix these)
diff --git a/src/konnektor/tests/network_planners/_networkx_implemenations/conftest.py b/src/konnektor/tests/network_planners/_networkx_implemenations/conftest.py
new file mode 100644
index 00000000..3db14627
--- /dev/null
+++ b/src/konnektor/tests/network_planners/_networkx_implemenations/conftest.py
@@ -0,0 +1,98 @@
+import pytest
+
+
+@pytest.fixture()
+def nine_mols_edges():
+    data = [
+        ["lig_12", "lig_14", 0.29531191028128656],
+        ["lig_10", "lig_11", 0.7534030360583935],
+        ["lig_12", "lig_13", 0.29531191028128656],
+        ["lig_9", "lig_15", 0.3934693402873666],
+        ["lig_10", "lig_12", 0.7274682069659875],
+        ["lig_13", "lig_14", 0.18126924692201818],
+        ["lig_9", "lig_11", 0.3934693402873666],
+        ["lig_10", "lig_15", 0.698805788087798],
+        ["lig_8", "lig_14", 0.36237184837822667],
+        ["lig_8", "lig_9", 0.5934303402594009],
+        ["lig_12", "lig_16", 0.3934693402873666],
+        ["lig_9", "lig_14", 0.3934693402873666],
+        ["lig_10", "lig_14", 0.7134952031398099],
+        ["lig_9", "lig_13", 0.3934693402873666],
+        ["lig_11", "lig_15", 0.3296799539643607],
+        ["lig_14", "lig_16", 0.3623718483782268],
+        ["lig_10", "lig_16", 0.7534030360583935],
+        ["lig_13", "lig_16", 0.3623718483782268],
+        ["lig_8", "lig_12", 0.5276334472589854],
+        ["lig_14", "lig_15", 0.22119921692859512],
+        ["lig_15", "lig_16", 0.3296799539643607],
+        ["lig_8", "lig_15", 0.47795422323898396],
+        ["lig_9", "lig_10", 0.7768698398515702],
+        ["lig_13", "lig_15", 0.22119921692859512],
+        ["lig_12", "lig_15", 0.2591817793182821],
+        ["lig_8", "lig_10", 0.8079500913792459],
+        ["lig_11", "lig_12", 0.3934693402873666],
+        ["lig_8", "lig_13", 0.47795422323898396],
+        ["lig_11", "lig_13", 0.3296799539643607],
+        ["lig_9", "lig_12", 0.36237184837822667],
+        ["lig_9", "lig_16", 0.42305018961951335],
+        ["lig_11", "lig_16", 0.25918177931828223],
+        ["lig_8", "lig_11", 0.5276334472589853],
+        ["lig_10", "lig_13", 0.7134952031398099],
+        ["lig_11", "lig_14", 0.3296799539643607],
+        ["lig_8", "lig_16", 0.5725850680512734],
+    ]
+
+    return data
+
+
+@pytest.fixture()
+def nine_mols_edges_two_sets():
+    data = [
+        ["lig_12", "lig_14", 0.29531191028128656],
+        ["lig_10", "lig_11", 0.7534030360583935],
+        ["lig_12", "lig_13", 0.29531191028128656],
+        ["lig_9", "lig_15", 0.3934693402873666],
+        ["lig_10", "lig_12", 0.7274682069659875],
+        ["lig_13", "lig_14", 0.18126924692201818],
+        ["lig_9", "lig_11", 0.3934693402873666],
+        ["lig_10", "lig_15", 0.698805788087798],
+        ["lig_8", "lig_14", 0.36237184837822667],
+        ["lig_8", "lig_9", 0.5934303402594009],
+        ["lig_12", "lig_16", 0.3934693402873666],
+        ["lig_9", "lig_14", 0.3934693402873666],
+        ["lig_10", "lig_14", 0.7134952031398099],
+        ["lig_9", "lig_13", 0.3934693402873666],
+        ["lig_11", "lig_15", 0.3296799539643607],
+        ["lig_14", "lig_16", 0.3623718483782268],
+        ["lig_10", "lig_16", 0.7534030360583935],
+        ["lig_13", "lig_16", 0.3623718483782268],
+        ["lig_8", "lig_12", 0.5276334472589854],
+        ["lig_14", "lig_15", 0.22119921692859512],
+        ["lig_15", "lig_16", 0.3296799539643607],
+        ["lig_8", "lig_15", 0.47795422323898396],
+        ["lig_9", "lig_10", 0.7768698398515702],
+        ["lig_13", "lig_15", 0.22119921692859512],
+        ["lig_12", "lig_15", 0.2591817793182821],
+        ["lig_8", "lig_10", 0.8079500913792459],
+        ["lig_11", "lig_12", 0.3934693402873666],
+        ["lig_8", "lig_13", 0.47795422323898396],
+        ["lig_11", "lig_13", 0.3296799539643607],
+        ["lig_9", "lig_12", 0.36237184837822667],
+        ["lig_9", "lig_16", 0.42305018961951335],
+        ["lig_11", "lig_16", 0.25918177931828223],
+        ["lig_8", "lig_11", 0.5276334472589853],
+        ["lig_10", "lig_13", 0.7134952031398099],
+        ["lig_11", "lig_14", 0.3296799539643607],
+        ["lig_8", "lig_16", 0.5725850680512734],
+    ]
+
+    eA = []
+    eB = []
+
+    for edge in data:
+        if int(edge[0].split("_")[-1]) < 10 and int(edge[0].split("_")[-1]) < 10:
+            eA.append(edge)
+        elif int(edge[0].split("_")[-1]) > 10 and int(edge[0].split("_")[-1]) > 10:
+            eB.append(edge)
+
+    return (eA, eB)
diff --git a/src/konnektor/tests/network_planners/_networkx_implemenations/test_bipartite_match_algorithm.py b/src/konnektor/tests/network_planners/_networkx_implemenations/test_bipartite_match_algorithm.py
index 824209fd..2a6a10bb 100644
--- a/src/konnektor/tests/network_planners/_networkx_implemenations/test_bipartite_match_algorithm.py
+++ b/src/konnektor/tests/network_planners/_networkx_implemenations/test_bipartite_match_algorithm.py
@@ -7,7 +7,6 @@
 from konnektor.network_planners._networkx_implementations import (
     bipartite_match_algorithm,
 )
-from konnektor.tests.data.conf import nine_mols_edges
 
 
 def test_mst_network_generation(nine_mols_edges):
diff --git a/src/konnektor/tests/network_planners/_networkx_implemenations/test_cyclic_graph_generator.py b/src/konnektor/tests/network_planners/_networkx_implemenations/test_cyclic_graph_generator.py
index b8ad93da..7ea84a0c 100644
--- a/src/konnektor/tests/network_planners/_networkx_implemenations/test_cyclic_graph_generator.py
+++ b/src/konnektor/tests/network_planners/_networkx_implemenations/test_cyclic_graph_generator.py
@@ -4,7 +4,6 @@
 import networkx as nx
 
 from konnektor.network_planners._networkx_implementations import CyclicNetworkAlgorithm
-from konnektor.tests.data.conf import nine_mols_edges
 
 
 # more test here also for the params
diff --git a/src/konnektor/tests/network_planners/_networkx_implemenations/test_mst_graph_generator.py b/src/konnektor/tests/network_planners/_networkx_implemenations/test_mst_graph_generator.py
index 35ccd87c..90da4bef 100644
--- a/src/konnektor/tests/network_planners/_networkx_implemenations/test_mst_graph_generator.py
+++ b/src/konnektor/tests/network_planners/_networkx_implemenations/test_mst_graph_generator.py
@@ -4,7 +4,6 @@
 import networkx as nx
 
 from konnektor.network_planners._networkx_implementations import MstNetworkAlgorithm
-from konnektor.tests.data.conf import nine_mols_edges
 
 
 def test_mst_network_generation(nine_mols_edges):
diff --git a/src/konnektor/tests/network_planners/_networkx_implemenations/test_n_edge_graph_generator.py b/src/konnektor/tests/network_planners/_networkx_implemenations/test_n_edge_graph_generator.py
index d9500b7b..9be1ea02 100644
--- a/src/konnektor/tests/network_planners/_networkx_implemenations/test_n_edge_graph_generator.py
+++ b/src/konnektor/tests/network_planners/_networkx_implemenations/test_n_edge_graph_generator.py
@@ -6,7 +6,6 @@
 from konnektor.network_planners._networkx_implementations import (
     NNodeEdgesNetworkAlgorithm,
 )
-from konnektor.tests.data.conf import nine_mols_edges
 
 
 def test_n_edge_network_generation(nine_mols_edges):
diff --git a/src/konnektor/tests/network_planners/_networkx_implemenations/test_radial_graph_generator.py b/src/konnektor/tests/network_planners/_networkx_implemenations/test_radial_graph_generator.py
index 5957f6ed..902834b1 100644
--- a/src/konnektor/tests/network_planners/_networkx_implemenations/test_radial_graph_generator.py
+++ b/src/konnektor/tests/network_planners/_networkx_implemenations/test_radial_graph_generator.py
@@ -6,7 +6,6 @@
 import pytest
 
 from konnektor.network_planners._networkx_implementations import RadialNetworkAlgorithm
-from konnektor.tests.data.conf import nine_mols_edges
 
 
 def test_radial_network_generation_find_center(nine_mols_edges):
diff --git a/src/konnektor/tests/network_planners/concatenators/test_bipartite_MST_connector.py b/src/konnektor/tests/network_planners/concatenators/test_bipartite_MST_connector.py
index ece27ec6..9605d728 100644
--- a/src/konnektor/tests/network_planners/concatenators/test_bipartite_MST_connector.py
+++ b/src/konnektor/tests/network_planners/concatenators/test_bipartite_MST_connector.py
@@ -7,9 +7,7 @@
 from konnektor.network_planners.concatenators import MstConcatenator
 from konnektor.tests.network_planners.conf import (
     GenAtomMapper,
-    atom_mapping_basic_test_files,
     genScorer,
-    ligand_network_ab,
 )
 
 
diff --git a/src/konnektor/tests/network_planners/concatenators/test_bipartite_max_concatenator.py b/src/konnektor/tests/network_planners/concatenators/test_bipartite_max_concatenator.py
index 917423da..ae531365 100644
--- a/src/konnektor/tests/network_planners/concatenators/test_bipartite_max_concatenator.py
+++ b/src/konnektor/tests/network_planners/concatenators/test_bipartite_max_concatenator.py
@@ -7,9 +7,7 @@
 from konnektor.network_planners.concatenators.max_concatenator import MaxConcatenator
 from konnektor.tests.network_planners.conf import (
     GenAtomMapper,
-    atom_mapping_basic_test_files,
     genScorer,
-    ligand_network_ab,
 )
 
 
diff --git a/src/konnektor/tests/network_planners/conf.py b/src/konnektor/tests/network_planners/conf.py
index 9d192206..304ffd1c 100644
--- a/src/konnektor/tests/network_planners/conf.py
+++ b/src/konnektor/tests/network_planners/conf.py
@@ -1,18 +1,12 @@
 # This code is part of OpenFE and is licensed under the MIT license.
 # For details, see https://github.com/OpenFreeEnergy/konnektor
 
-import importlib
 import inspect
-from importlib import resources
 
-import pytest
-from gufe import AtomMapper, LigandAtomMapping, LigandNetwork, SmallMoleculeComponent
+from gufe import AtomMapper, LigandAtomMapping, SmallMoleculeComponent
 from rdkit import Chem
 from rdkit.Chem import AllChem
 
-import konnektor
-from konnektor import network_planners
-
 
 def mol_from_smiles(smiles: str) -> Chem.Mol:
     m = Chem.MolFromSmiles(smiles)
@@ -21,28 +15,6 @@ def mol_from_smiles(smiles: str) -> Chem.Mol:
     return m
 
 
-@pytest.fixture(scope="session")
-def atom_mapping_basic_test_files():
-    # a dict of {filenames.strip(mol2): SmallMoleculeComponent} for a simple
-    # set of ligands
-    files = {}
-    for f in [
-        "1,3,7-trimethylnaphthalene",
-        "1-butyl-4-methylbenzene",
-        "2,6-dimethylnaphthalene",
-        "2-methyl-6-propylnaphthalene",
-        "2-methylnaphthalene",
-        "2-naftanol",
-        "methylcyclohexane",
-        "toluene",
-    ]:
-        with importlib.resources.path("konnektor.tests.data", f + ".mol2") as fn:
-            mol = Chem.MolFromMol2File(str(fn), removeHs=False)
-            files[f] = SmallMoleculeComponent(mol, name=f)
-
-    return files
-
-
 class DummyAtomMapper(AtomMapper):
     @classmethod
     def _from_dict(cls, d: dict):
@@ -114,31 +86,3 @@ def suggest_mappings(
 
 def genScorer(mapping):
     return 1.0 / len(mapping.componentA_to_componentB)
-
-
-@pytest.fixture(scope="session")
-def toluene_vs_others(atom_mapping_basic_test_files):
-    central_ligand_name = "toluene"
-    others = [v for (k, v) in atom_mapping_basic_test_files.items() if k != central_ligand_name]
-    toluene = atom_mapping_basic_test_files[central_ligand_name]
-    return toluene, others
-
-
-@pytest.fixture(scope="session")
-def ligand_network_ab(atom_mapping_basic_test_files):
-    mappingsA = []
-    mappingsB = []
-
-    for _, mA in atom_mapping_basic_test_files.items():
-        for _, mB in atom_mapping_basic_test_files.items():
-            m = LigandAtomMapping(mA, mB, {}).with_annotations({"score": 1})
-            if mA == mB:
-                continue
-            elif mA.name.startswith("2") and mB.name.startswith("2"):
-                mappingsA.append(m)
-            elif not (mA.name.startswith("2") or mB.name.startswith("2")):
-                mappingsB.append(m)
-
-    lna = LigandNetwork(edges=mappingsA)
-    lnb = LigandNetwork(edges=mappingsB)
-    return (lna, lnb)
diff --git a/src/konnektor/tests/network_planners/conftest.py b/src/konnektor/tests/network_planners/conftest.py
new file mode 100644
index 00000000..b19e71a0
--- /dev/null
+++ b/src/konnektor/tests/network_planners/conftest.py
@@ -0,0 +1,55 @@
+import importlib
+
+import pytest
+from gufe import LigandAtomMapping, LigandNetwork, SmallMoleculeComponent
+from rdkit import Chem
+
+
+@pytest.fixture(scope="session")
+def toluene_vs_others(atom_mapping_basic_test_files):
+    central_ligand_name = "toluene"
+    others = [v for (k, v) in atom_mapping_basic_test_files.items() if k != central_ligand_name]
+    toluene = atom_mapping_basic_test_files[central_ligand_name]
+    return toluene, others
+
+
+@pytest.fixture(scope="session")
+def atom_mapping_basic_test_files():
+    # a dict of {filenames.strip(mol2): SmallMoleculeComponent} for a simple
+    # set of ligands
+    files = {}
+    for f in [
+        "1,3,7-trimethylnaphthalene",
+        "1-butyl-4-methylbenzene",
+        "2,6-dimethylnaphthalene",
+        "2-methyl-6-propylnaphthalene",
+        "2-methylnaphthalene",
+        "2-naftanol",
+        "methylcyclohexane",
+        "toluene",
+    ]:
+        with importlib.resources.path("konnektor.tests.data", f + ".mol2") as fn:
+            mol = Chem.MolFromMol2File(str(fn), removeHs=False)
+            files[f] = SmallMoleculeComponent(mol, name=f)
+
+    return files
+
+
+@pytest.fixture(scope="session")
+def ligand_network_ab(atom_mapping_basic_test_files):
+    mappingsA = []
+    mappingsB = []
+
+    for _, mA in atom_mapping_basic_test_files.items():
+        for _, mB in atom_mapping_basic_test_files.items():
+            m = LigandAtomMapping(mA, mB, {}).with_annotations({"score": 1})
+            if mA == mB:
+                continue
+            elif mA.name.startswith("2") and mB.name.startswith("2"):
+                mappingsA.append(m)
+            elif not (mA.name.startswith("2") or mB.name.startswith("2")):
+                mappingsB.append(m)
+
+    lna = LigandNetwork(edges=mappingsA)
+    lnb = LigandNetwork(edges=mappingsB)
+    return (lna, lnb)
diff --git a/src/konnektor/tests/network_planners/generators/test_heuristic_maximal_network_planner.py b/src/konnektor/tests/network_planners/generators/test_heuristic_maximal_network_planner.py
index 3735b521..e9cb157f 100644
--- a/src/konnektor/tests/network_planners/generators/test_heuristic_maximal_network_planner.py
+++ b/src/konnektor/tests/network_planners/generators/test_heuristic_maximal_network_planner.py
@@ -9,7 +9,6 @@
     BadMapper,
     GenAtomMapper,
     SuperBadMapper,
-    genScorer,
 )
 from konnektor.utils.toy_data import build_random_dataset
 
diff --git a/src/konnektor/tests/network_planners/generators/test_maximal_network_planner.py b/src/konnektor/tests/network_planners/generators/test_maximal_network_planner.py
index 62e69140..fc456ddd 100644
--- a/src/konnektor/tests/network_planners/generators/test_maximal_network_planner.py
+++ b/src/konnektor/tests/network_planners/generators/test_maximal_network_planner.py
@@ -2,18 +2,14 @@
 # For details, see https://github.com/OpenFreeEnergy/konnektor
 
 import pytest
-from gufe import AtomMapper, AtomMapping, LigandAtomMapping
 
 from konnektor.network_planners import MaximalNetworkGenerator
 from konnektor.tests.network_planners.conf import (
     BadMapper,
     GenAtomMapper,
     SuperBadMapper,
-    atom_mapping_basic_test_files,
     genScorer,
-    toluene_vs_others,
 )
-from konnektor.utils.toy_data import build_random_dataset
 
 
 @pytest.mark.parametrize("n_process", [1, 2])
diff --git a/src/konnektor/tests/network_planners/generators/test_mst_network_planner.py b/src/konnektor/tests/network_planners/generators/test_mst_network_planner.py
index 7e26b7b1..b8476da6 100644
--- a/src/konnektor/tests/network_planners/generators/test_mst_network_planner.py
+++ b/src/konnektor/tests/network_planners/generators/test_mst_network_planner.py
@@ -12,10 +12,8 @@
 from konnektor.tests.network_planners.conf import (
     ErrorMapper,
     GenAtomMapper,
-    atom_mapping_basic_test_files,
     genScorer,
     mol_from_smiles,
-    toluene_vs_others,
 )
 
 
diff --git a/src/konnektor/tests/network_planners/generators/test_nedges_netwok_planner.py b/src/konnektor/tests/network_planners/generators/test_nedges_network_planner.py
similarity index 96%
rename from src/konnektor/tests/network_planners/generators/test_nedges_netwok_planner.py
rename to src/konnektor/tests/network_planners/generators/test_nedges_network_planner.py
index 8774b5fc..99515839 100644
--- a/src/konnektor/tests/network_planners/generators/test_nedges_netwok_planner.py
+++ b/src/konnektor/tests/network_planners/generators/test_nedges_network_planner.py
@@ -8,7 +8,6 @@
 from konnektor.network_planners import NNodeEdgesNetworkGenerator
 from konnektor.tests.network_planners.conf import (
     GenAtomMapper,
-    atom_mapping_basic_test_files,
     genScorer,
 )
 
diff --git a/src/konnektor/tests/network_planners/generators/test_rmst_netwok_planner.py b/src/konnektor/tests/network_planners/generators/test_rmst_network_planner.py
similarity index 97%
rename from src/konnektor/tests/network_planners/generators/test_rmst_netwok_planner.py
rename to src/konnektor/tests/network_planners/generators/test_rmst_network_planner.py
index e96f74f5..1c6eb35d 100644
--- a/src/konnektor/tests/network_planners/generators/test_rmst_netwok_planner.py
+++ b/src/konnektor/tests/network_planners/generators/test_rmst_network_planner.py
@@ -12,10 +12,8 @@
 from konnektor.tests.network_planners.conf import (
     ErrorMapper,
     GenAtomMapper,
-    atom_mapping_basic_test_files,
     genScorer,
     mol_from_smiles,
-    toluene_vs_others,
 )
 
 
diff --git a/src/konnektor/tests/network_planners/generators/test_star_network_planner.py b/src/konnektor/tests/network_planners/generators/test_star_network_planner.py
index 9a625fff..a882d878 100644
--- a/src/konnektor/tests/network_planners/generators/test_star_network_planner.py
+++ b/src/konnektor/tests/network_planners/generators/test_star_network_planner.py
@@ -9,10 +9,8 @@
     BadMapper,
     ErrorMapper,
     GenAtomMapper,
-    atom_mapping_basic_test_files,
     genScorer,
     mol_from_smiles,
-    toluene_vs_others,
 )
 
 
diff --git a/src/konnektor/tests/network_planners/generators/test_twin_star_network_planner.py b/src/konnektor/tests/network_planners/generators/test_twin_star_network_planner.py
index a0ef215e..92ae9761 100644
--- a/src/konnektor/tests/network_planners/generators/test_twin_star_network_planner.py
+++ b/src/konnektor/tests/network_planners/generators/test_twin_star_network_planner.py
@@ -2,7 +2,6 @@
 # For details, see https://github.com/OpenFreeEnergy/konnektor
 
 import numpy as np
-import pytest
 from gufe import LigandNetwork
 
 from konnektor.network_analysis import get_is_connected, get_network_score
diff --git a/src/konnektor/tests/test_data.py b/src/konnektor/tests/test_data.py
index 886aedf1..177bc463 100644
--- a/src/konnektor/tests/test_data.py
+++ b/src/konnektor/tests/test_data.py
@@ -1,7 +1,6 @@
 # This code is part of OpenFE and is licensed under the MIT license.
 # For details, see https://github.com/OpenFreeEnergy/konnektor
 
-import pytest
 from gufe import SmallMoleculeComponent
 
 from konnektor.data import get_benzene_ligands, get_charged_ligands, get_hif2a_ligands


Reviews:
user: login: mikemhenry
body: LGTM! Really my only comment was about the scope, AFAIK really what is important is to make sure the objects that the fixtures return or manipulate are safe to be reused, so they shouldn't mutate or affect the state of things 
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-11T21:39:11Z
user: login: atravitz
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-11T22:48:08Z
user: login: atravitz
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-11T22:51:24Z

Review comments:
diff_hunk: @@ -0,0 +1,98 @@
+import pytest
+
+
+@pytest.fixture(scope="session")
path: src/konnektor/tests/network_planners/_networkx_implemenations/conftest.py
user: login: mikemhenry
body: I am assuming these never get mutated? 
created_at: 2025-03-11T21:37:19Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,98 @@
+import pytest
+
+
+@pytest.fixture(scope="session")
path: src/konnektor/tests/network_planners/_networkx_implemenations/conftest.py
user: login: atravitz
body: correct, but I also don't like session scoped things unless totally necessary. I dont think there's anything to warrant a session scope here (complex or expensive setup), so i'm taking it out!
created_at: 2025-03-11T22:48:08Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,98 @@
+import pytest
+
+
+@pytest.fixture(scope="session")
path: src/konnektor/tests/network_planners/_networkx_implemenations/conftest.py
user: login: atravitz
body: p.s. there's a couple other places with session scope I want to change, but i want to check how much it slows our tests down first. something for another PR.
created_at: 2025-03-11T22:51:24Z
author_association: CONTRIBUTOR

PR comments:
user: login: codecov[bot]
created_at: 2025-03-11T17:03:17Z
body: ## [Codecov](https://app.codecov.io/gh/OpenFreeEnergy/konnektor/pull/125?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=OpenFreeEnergy) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 87.80%. Comparing base [(`0841aae`)](https://app.codecov.io/gh/OpenFreeEnergy/konnektor/commit/0841aaeee76d40c5b25a38c328f6122c01af910d?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=OpenFreeEnergy) to head [(`8192d48`)](https://app.codecov.io/gh/OpenFreeEnergy/konnektor/commit/8192d4861842891c0233d548050acb64bd604e4b?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=OpenFreeEnergy).
> Report is 17 commits behind head on main.

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff             @@
##             main     #125      +/-   ##
==========================================
- Coverage   87.93%   87.80%   -0.13%     
==========================================
  Files          49       49              
  Lines        1542     1542              
==========================================
- Hits         1356     1354       -2     
- Misses        186      188       +2     
```

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/OpenFreeEnergy/konnektor/pull/125?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=OpenFreeEnergy).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=OpenFreeEnergy).

<details><summary> :rocket: New features to boost your workflow: </summary>

- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
</details>
author_association: NONE
user: login: atravitz
created_at: 2025-03-11T22:49:34Z
body: pre-commit.ci autofix

author_association: CONTRIBUTOR
user: login: atravitz
created_at: 2025-03-11T23:13:39Z
body: thanks! i'm going to look into the code coverage drop before merging
author_association: CONTRIBUTOR
user: login: mikemhenry
created_at: 2025-03-11T23:55:21Z
body: RE: coverage, one thing that is odd is it looks like the tests are excluded from coverage 
![image](https://github.com/user-attachments/assets/d2447401-c62b-4524-a2eb-402e7bfc54ea)
https://app.codecov.io/gh/OpenFreeEnergy/konnektor/tree/main/src%2Fkonnektor

author_association: CONTRIBUTOR
user: login: mikemhenry
created_at: 2025-03-11T23:56:57Z
body: Ah they are excluded -- I'll make an issue
author_association: CONTRIBUTOR