test_pytest_plugins.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:tox 作者: tox-dev 项目源码 文件源码
def test_broken_py_path_local_join_workaround_on_Windows(
            self, tmpdir, initproj, monkeypatch):
        # construct an absolute folder path for our src_root folder without the
        # Windows drive indicator
        src_root = tmpdir.join('spam')
        src_root = _path_parts(src_root)
        src_root[0] = ''
        src_root = '/'.join(src_root)

        # make sure tmpdir drive is the current one so the constructed src_root
        # folder path gets interpreted correctly on Windows
        monkeypatch.chdir(tmpdir)

        # will throw an assertion error if the bug is not worked around
        initproj('spam-666', src_root=src_root)

        init_file = tmpdir.join('spam', 'spam', '__init__.py')
        assert init_file.read_binary() == b"__version__ = '666'"
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号