RonnyPfannschmidt / anyvc
generic vcs abstraction (used in pida)
Clone this repository (size: 300.7 KB): HTTPS / SSH
$ hg clone http://bitbucket.org/RonnyPfannschmidt/anyvc/
| commit 278: | 01adf08aa32d |
| parent 277: | 06765266870a |
| branch: | default |
conftest now supports vcs selection
- View RonnyPfannschmidt's profile
-
RonnyPfannschmidt's public repos »
- pida-patches
- vimish
- virtualenvmanager
- py-virtualenv
- pida-hacks
- distribute-0.6
- distribute-resources
- pytest-codecheckers
- py-execnet3k
- gexcept
- glashammer-main
- flatland-htmlwidgets
- django-vcstorage-new-anyvc
- hgpaste
- chrome-markman
- apipkg
- kij
- gtkarchitect-main
- gazpacho
- plugpost
- rope-qickfix
- pyscope
- anyvc
- prolog
- Send message
2 months ago
Changed (Δ381 bytes):
raw changeset »
conftest.py (12 lines added, 1 lines removed)
| … | … | @@ -14,6 +14,7 @@ test_on = { |
14 |
14 |
|
15 |
15 |
def pytest_addoption(parser): |
16 |
16 |
parser.addoption("--local-remoting", action="store_true", default=False) |
17 |
parser.addoption("--vcs", action='store', default=None) |
|
17 |
18 |
|
18 |
19 |
def pytest_configure(config): |
19 |
20 |
if not config.getvalue('local_remoting'): |
| … | … | @@ -21,12 +22,22 @@ def pytest_configure(config): |
21 |
22 |
if '/' in key: |
22 |
23 |
del test_on[key] |
23 |
24 |
|
25 |
vcs = config.getvalue('vcs') |
|
26 |
if vcs not in metadata.backends: |
|
27 |
if vcs in metadata.aliases: |
|
28 |
vcs = metadata.aliases[vcs] |
|
29 |
config.option.vcs = vcs |
|
30 |
else: |
|
31 |
raise KeyError(vcs, 'not found') |
|
32 |
||
24 |
33 |
def pytest_generate_tests(metafunc): |
25 |
34 |
if 'mgr' not in metafunc.funcargnames: |
26 |
35 |
return |
27 |
36 |
for name in metadata.backends: |
37 |
wanted = metafunc.config.getvalue('vcs') |
|
38 |
if wanted is not None and name!=wanted: |
|
39 |
continue |
|
28 |
40 |
for id, spec in test_on.items(): |
29 |
print repr(id), repr(name) |
|
30 |
41 |
metafunc.addcall(id=id%name, param=(name, spec)) |
31 |
42 |
|
32 |
43 |
