Exemplo n.º 1
0
 def test_getcfg_and_config(self, testdir, tmpdir, section, filename):
     sub = tmpdir.mkdir("sub")
     sub.chdir()
     tmpdir.join(filename).write(_pytest._code.Source("""
         [{section}]
         name = value
     """.format(section=section)))
     rootdir, inifile, cfg = getcfg([sub])
     assert cfg['name'] == "value"
     config = testdir.parseconfigure(sub)
     assert config.inicfg['name'] == 'value'
Exemplo n.º 2
0
 def test_getcfg_and_config(self, testdir, tmpdir):
     sub = tmpdir.mkdir("sub")
     sub.chdir()
     tmpdir.join("setup.cfg").write(py.code.Source("""
         [pytest]
         name = value
     """))
     rootdir, inifile, cfg = getcfg([sub], ["setup.cfg"])
     assert cfg['name'] == "value"
     config = testdir.parseconfigure(sub)
     assert config.inicfg['name'] == 'value'
Exemplo n.º 3
0
 def test_getcfg_and_config(self, testdir, tmpdir):
     sub = tmpdir.mkdir("sub")
     sub.chdir()
     tmpdir.join("setup.cfg").write(
         py.code.Source("""
         [pytest]
         name = value
     """))
     rootdir, inifile, cfg = getcfg([sub], ["setup.cfg"])
     assert cfg['name'] == "value"
     config = testdir.parseconfigure(sub)
     assert config.inicfg['name'] == 'value'
Exemplo n.º 4
0
 def test_getcfg_and_config(self, testdir, tmpdir, section, filename):
     sub = tmpdir.mkdir("sub")
     sub.chdir()
     tmpdir.join(filename).write(
         _pytest._code.Source("""
         [{section}]
         name = value
     """.format(section=section)))
     rootdir, inifile, cfg = getcfg([sub])
     assert cfg['name'] == "value"
     config = testdir.parseconfigure(sub)
     assert config.inicfg['name'] == 'value'
Exemplo n.º 5
0
 def test_getcfg_empty_path(self, tmpdir):
     getcfg([''], ['setup.cfg'])  #happens on py.test ""
Exemplo n.º 6
0
 def test_getcfg_empty_path(self):
     """correctly handle zero length arguments (a la pytest '')"""
     getcfg([''])
Exemplo n.º 7
0
 def test_getcfg_empty_path(self):
     """correctly handle zero length arguments (a la pytest '')"""
     getcfg([''])
Exemplo n.º 8
0
from _pytest.config import get_common_ancestor, getcfg
import sys
from testmon.testmon_core import get_variant_inifile, Testmon


ancestor = get_common_ancestor(sys.argv[1:])
rootdir, inifile, inicfg = getcfg(
    [ancestor], ["pytest.ini", "tox.ini", "setup.cfg"])
if rootdir is None:
    for rootdir in ancestor.parts(reverse=True):
        if rootdir.join("setup.py").exists():
            break
    else:
        rootdir = ancestor

variant = get_variant_inifile(inifile)

testmon = Testmon([str(rootdir)], variant=variant )
testmon.read_fs()


node_files = testmon.file_data().keys()

changed_files = []
for node_file in node_files:
    if testmon.old_mtimes.get(node_file) != testmon.mtimes.get(node_file):
        changed_files.append(node_file)
print "Changed files:%s " % changed_files

print rootdir, inifile, inicfg
Exemplo n.º 9
0
 def test_getcfg_empty_path(self, tmpdir):
     getcfg([''], ['setup.cfg']) #happens on py.test ""
Exemplo n.º 10
0
 def test_getcfg_empty_path(self, tmpdir):
     getcfg([""], ["setup.cfg"])  # happens on py.test ""