-
Notifications
You must be signed in to change notification settings - Fork 687
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5585 from freedomofpress/updates_pytest_pluggy_te…
…stinfra_molecule_and_the_universe Updates pytest pluggy testinfra molecule and the universe
- Loading branch information
Showing
64 changed files
with
387 additions
and
213 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
pytest==3.2.0 | ||
testinfra==3.2.0 | ||
pytest-xdist==1.18.2 | ||
paramiko==2.6.0 | ||
pytest==6.1.1 | ||
testinfra==5.3.1 | ||
pytest-xdist==2.1.0 | ||
paramiko==2.7.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,19 @@ | ||
""" | ||
Import variables from vars.yml and inject into pytest namespace | ||
Import variables from vars.yml and inject into testutils namespace | ||
""" | ||
|
||
import os | ||
import io | ||
import yaml | ||
import testutils | ||
|
||
|
||
def pytest_namespace(): | ||
""" Return dict of vars imported as 'securedrop_test_vars' into pytest | ||
global namespace | ||
""" | ||
filepath = os.path.join(os.path.dirname(__file__), "vars.yml") | ||
with io.open(filepath, 'r') as f: | ||
securedrop_test_vars = yaml.safe_load(f) | ||
filepath = os.path.join(os.path.dirname(__file__), "vars.yml") | ||
with io.open(filepath, 'r') as f: | ||
securedrop_test_vars = yaml.safe_load(f) | ||
|
||
# Tack on target OS for use in tests | ||
securedrop_target_platform = os.environ.get("SECUREDROP_TARGET_PLATFORM") | ||
securedrop_test_vars["securedrop_target_platform"] = securedrop_target_platform | ||
# Wrapping the return value to accommodate for pytest namespacing | ||
return dict(securedrop_test_vars=securedrop_test_vars) | ||
# Tack on target OS for use in tests | ||
securedrop_target_platform = os.environ.get("SECUREDROP_TARGET_PLATFORM") | ||
securedrop_test_vars["securedrop_target_platform"] = securedrop_target_platform | ||
|
||
testutils.securedrop_test_vars = testutils.inject_vars(securedrop_test_vars) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class Myvalues: | ||
def __init__(self): | ||
pass | ||
|
||
|
||
securedrop_test_vars = Myvalues() | ||
|
||
|
||
def inject_vars(value): | ||
res = Myvalues() | ||
for key, value in value.items(): | ||
setattr(res, key, value) | ||
return res |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.