Exemplo n.º 1
0
    def test_want_module(self):
        m = mod('whatever')
        m2 = mod('this.that')
        m3 = mod('this.that.another')
        m4 = mod('this.that.another.one')
        m5 = mod('test.something')
        m6 = mod('a.test')
        m7 = mod('my_tests')
        m8 = mod('__main__')

        s = Selector(Config())
        assert not s.wantModule(m)
        assert not s.wantModule(m2)
        assert not s.wantModule(m3)
        assert not s.wantModule(m4)
        assert not s.wantModule(m5)
        assert s.wantModule(m6)
        assert s.wantModule(m7)
        assert s.wantModule(m8)

        m6.__test__ = False
        assert not s.wantModule(m6), "Failed to respect __test__ = False"
Exemplo n.º 2
0
    def test_want_module(self):
        m = mod('whatever')
        m2 = mod('this.that')
        m3 = mod('this.that.another')
        m4 = mod('this.that.another.one')
        m5 = mod('test.something')
        m6 = mod('a.test')
        m7 = mod('my_tests')
        m8 = mod('__main__')
        
        s = Selector(Config())
        assert not s.wantModule(m)
        assert not s.wantModule(m2)
        assert not s.wantModule(m3)
        assert not s.wantModule(m4)
        assert not s.wantModule(m5)
        assert s.wantModule(m6)
        assert s.wantModule(m7)
        assert s.wantModule(m8)

        m6.__test__ = False
        assert not s.wantModule(m6), "Failed to respect __test__ = False"
Exemplo n.º 3
0
    def test_want_module(self):
        m = mod("whatever")
        m2 = mod("this.that")
        m3 = mod("this.that.another")
        m4 = mod("this.that.another.one")
        m5 = mod("test.something")
        m6 = mod("a.test")
        m7 = mod("my_tests")
        m8 = mod("__main__")

        s = Selector(Config())
        assert not s.wantModule(m)
        assert not s.wantModule(m2)
        assert not s.wantModule(m3)
        assert not s.wantModule(m4)
        assert not s.wantModule(m5)
        assert s.wantModule(m6)
        assert s.wantModule(m7)
        assert s.wantModule(m8)

        m6.__test__ = False
        assert not s.wantModule(m6), "Failed to respect __test__ = False"