예제 #1
0
def test_get_module_name_path4():
    def yay():
        pass

    yay.__module__ = "__main__"
    sys.modules["__main__"].__file__ = "a/b.py"

    # Calling the function on itself
    assert utils._get_module_name(yay) == "a.b"
예제 #2
0
def test_get_module_name_path2():
    def yay():
        pass

    yay.__module__ = "__main__"
    # We're probably doing strange things to the pytest binary
    # but it's probably harmless
    del sys.modules["__main__"].__file__

    # Calling the function on itself
    assert utils._get_module_name(yay) == "__main__"
예제 #3
0
def test_get_module_name_path1():
    # Calling the function on itself
    assert utils._get_module_name(utils._get_module_name) == "procrastinate.utils"