summaryrefslogtreecommitdiff
path: root/python/tests/top_level_dirs/main.py
blob: 9f30bfa01fe8ef57ac312f8b970e6ddaef9a41ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import unittest
import sys

print(sys.path, file=sys.stderr)

class TestProtoWithPkgPath(unittest.TestCase):

    def test_cant_import_mymodule_directly(self):
        with self.assertRaises(ImportError):
            import mymodule

    def test_can_import_mymodule_by_parent_package(self):
        import mypkg.mymodule


if __name__ == '__main__':
    unittest.main()