Skip to content

Commit 509af98

Browse files
committed
tests: move __init__ to common
Treat tests as a directory full of modules, rather than as a package. This will allow us to stop adding the root of the repo to the Python path. Signed-off-by: Benjamin Gilbert <[email protected]>
1 parent 8796961 commit 509af98

File tree

5 files changed

+6
-8
lines changed

5 files changed

+6
-8
lines changed
File renamed without changes.

tests/test_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919

2020
import unittest
2121

22-
from openslide import ImageSlide, OpenSlide, open_slide
22+
from common import file_path
2323

24-
from . import file_path
24+
from openslide import ImageSlide, OpenSlide, open_slide
2525

2626

2727
class TestLibrary(unittest.TestCase):

tests/test_deepzoom.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919

2020
import unittest
2121

22+
from common import file_path
23+
2224
from openslide import ImageSlide, OpenSlide
2325
from openslide.deepzoom import DeepZoomGenerator
2426

25-
from . import file_path
26-
2727

2828
class _BoxesDeepZoomTest:
2929
def setUp(self):

tests/test_imageslide.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@
2020
import unittest
2121

2222
from PIL import Image
23+
from common import file_path, maybe_supported
2324

2425
from openslide import ImageSlide, OpenSlideCache, OpenSlideError
2526

26-
from . import file_path, maybe_supported
27-
2827

2928
class TestImageWithoutOpening(unittest.TestCase):
3029
def test_detect_format(self):

tests/test_openslide.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import unittest
2424

2525
from PIL import Image
26+
from common import file_path, maybe_supported
2627

2728
from openslide import (
2829
OpenSlide,
@@ -31,8 +32,6 @@
3132
OpenSlideUnsupportedFormatError,
3233
)
3334

34-
from . import file_path, maybe_supported
35-
3635

3736
class TestCache(unittest.TestCase):
3837
@maybe_supported

0 commit comments

Comments
 (0)