Skip to content

Commit c76174e

Browse files
committed
Try fixing test_setup.py
1 parent b3edd80 commit c76174e

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

tests/test_setup.py

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
1-
import scc
21
import pkgutil
32

3+
import toml
4+
5+
import scc
6+
7+
48
class TestSetup(object):
5-
"""
6-
Tests if SCC should be installable.
7-
"""
8-
9+
"""Test if SCC should be installable."""
10+
911
def test_packages(self):
10-
"""
11-
Tests if every known Action is documentated in docs/actions.md
12-
"""
12+
"""Test if every known Action is documented in docs/actions.md."""
1313
try:
1414
import gi
15-
gi.require_version('Gtk', '3.0')
16-
gi.require_version('GdkX11', '3.0')
17-
gi.require_version('Rsvg', '2.0')
15+
gi.require_version('Gtk', '3.0')
16+
gi.require_version('GdkX11', '3.0')
17+
gi.require_version('Rsvg', '2.0')
1818
except ImportError:
1919
pass
20-
21-
from setup import packages
20+
21+
# Load the packages from pyproject.toml
22+
pyproject = toml.load("pyproject.toml")
23+
packages = pyproject["tool"]["setuptools"]["packages"]
24+
2225
for importer, modname, ispkg in pkgutil.walk_packages(path=scc.__path__, prefix="scc.", onerror=lambda x: None):
2326
if ispkg:
24-
assert modname in packages, "Package '%s' is not being installed by setup.py" % (modname,)
27+
assert modname in packages, f"Package '{modname}' is not being installed by setup.py"

0 commit comments

Comments
 (0)