17 lines
543 B
Python
17 lines
543 B
Python
import pathlib
|
|
import re
|
|
import sys
|
|
import unittest
|
|
|
|
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
|
|
|
|
from machine_load.slots import CPUS_PER_SLOT
|
|
from repo_checks import ROOT
|
|
|
|
|
|
class TestLine(unittest.TestCase):
|
|
def test_the_readme_runs_the_tests_in_one_heavy_slots_cpus(self):
|
|
workers = re.search(r"pytest==\S+ -n (\d+) bin`", (ROOT / "README.md").read_text(encoding="utf-8"))
|
|
self.assertIsNotNone(workers, "README.md's Test line runs `pytest==X -n N bin`")
|
|
self.assertEqual(int(workers.group(1)), CPUS_PER_SLOT)
|