Changeset - 9b6d562d46f5
[Not reviewed]
0 2 0
Brett Smith - 4 years ago 2020-05-06 18:48:27
brettcsmith@brettcsmith.org
tests: Stop calling fixtures directly.

Avoid deprecation warnings from pytest.
2 files changed with 38 insertions and 38 deletions:
0 comments (0 inline, 0 general)
tests/test_Configuration.py
Show inline comments
...
 
@@ -15,5 +15,3 @@ INI_DIR_PATH = relpath('config_ini')
 

	
 
def config_from(ini_filename, arglist=None):
 
    if arglist is None:
 
        arglist = ['historical', any_date().isoformat()]
 
def config_from(ini_filename, arglist):
 
    ini_path = INI_DIR_PATH / ini_filename
...
 
@@ -21,4 +19,4 @@ def config_from(ini_filename, arglist=None):
 

	
 
def test_full_config():
 
    config = config_from('full.ini')
 
def test_full_config(any_date):
 
    config = config_from('full.ini', ['historical', any_date.isoformat()])
 
    loaders = config.get_loaders().loaders
...
 
@@ -29,8 +27,8 @@ def test_full_config():
 

	
 
def test_incomplete_config():
 
    config = config_from('incomplete.ini')
 
def test_incomplete_config(any_date):
 
    config = config_from('incomplete.ini', ['historical', any_date.isoformat()])
 
    assert not config.get_loaders().loaders
 

	
 
def test_empty_config():
 
    config = config_from(os.devnull)
 
def test_empty_config(any_date):
 
    config = config_from(os.devnull, ['historical', any_date.isoformat()])
 
    assert not config.get_loaders().loaders
tests/test_historical.py
Show inline comments
...
 
@@ -45,3 +45,3 @@ def build_config(
 
        responder,
 
        date=None,
 
        date,
 
        amount=None,
...
 
@@ -55,3 +55,3 @@ def build_config(
 
    return FakeConfig(responder, {
 
        'date': any_date() if date is None else date,
 
        'date': date,
 
        'base': base,
...
 
@@ -70,4 +70,4 @@ def lines_from_run(config, output):
 

	
 
def test_rate_list(historical1_responder, output):
 
    config = build_config(historical1_responder)
 
def test_rate_list(historical1_responder, output, any_date):
 
    config = build_config(historical1_responder, any_date)
 
    lines = lines_from_run(config, output)
...
 
@@ -80,4 +80,4 @@ def test_rate_list(historical1_responder, output):
 

	
 
def test_one_rate(historical1_responder, output):
 
    config = build_config(historical1_responder, from_currency='ANG')
 
def test_one_rate(historical1_responder, output, any_date):
 
    config = build_config(historical1_responder, any_date, from_currency='ANG')
 
    lines = lines_from_run(config, output)
...
 
@@ -87,4 +87,4 @@ def test_one_rate(historical1_responder, output):
 

	
 
def test_conversion(historical1_responder, output):
 
    config = build_config(historical1_responder, amount=10, from_currency='AED')
 
def test_conversion(historical1_responder, output, any_date):
 
    config = build_config(historical1_responder, any_date, amount=10, from_currency='AED')
 
    lines = lines_from_run(config, output)
...
 
@@ -93,4 +93,4 @@ def test_conversion(historical1_responder, output):
 

	
 
def test_back_conversion(historical1_responder, output):
 
    config = build_config(historical1_responder,
 
def test_back_conversion(historical1_responder, output, any_date):
 
    config = build_config(historical1_responder, any_date,
 
                          amount=2, from_currency='USD', to_currency='ALL')
...
 
@@ -100,4 +100,5 @@ def test_back_conversion(historical1_responder, output):
 

	
 
def test_ledger_rate(historical1_responder, output):
 
    config = build_config(historical1_responder, from_currency='ANG', ledger=True)
 
def test_ledger_rate(historical1_responder, output, any_date):
 
    config = build_config(historical1_responder, any_date,
 
                          from_currency='ANG', ledger=True)
 
    lines = lines_from_run(config, output)
...
 
@@ -107,4 +108,5 @@ def test_ledger_rate(historical1_responder, output):
 

	
 
def test_ledger_conversion(historical1_responder, output):
 
    config = build_config(historical1_responder, from_currency='ALL', amount=300, ledger=True)
 
def test_ledger_conversion(historical1_responder, output, any_date):
 
    config = build_config(historical1_responder, any_date,
 
                          from_currency='ALL', amount=300, ledger=True)
 
    lines = lines_from_run(config, output)
...
 
@@ -114,5 +116,5 @@ def test_ledger_conversion(historical1_responder, output):
 

	
 
def test_signed_currencies(historical1_responder, output):
 
    config = build_config(historical1_responder, from_currency='AED',
 
                          ledger=True, signed_currencies=['EUR'])
 
def test_signed_currencies(historical1_responder, output, any_date):
 
    config = build_config(historical1_responder, any_date,
 
                          from_currency='AED', ledger=True, signed_currencies=['EUR'])
 
    lines = lines_from_run(config, output)
...
 
@@ -122,5 +124,5 @@ def test_signed_currencies(historical1_responder, output):
 

	
 
def test_denomination(historical1_responder, output):
 
    config = build_config(historical1_responder, from_currency='ANG',
 
                          to_currency='AED', amount=10,
 
def test_denomination(historical1_responder, output, any_date):
 
    config = build_config(historical1_responder, any_date,
 
                          from_currency='ANG', to_currency='AED', amount=10,
 
                          ledger=True, denomination='USD')
...
 
@@ -131,5 +133,5 @@ def test_denomination(historical1_responder, output):
 

	
 
def test_redundant_denomination(historical1_responder, output):
 
    config = build_config(historical1_responder, from_currency='ANG',
 
                          to_currency='USD', amount=10,
 
def test_redundant_denomination(historical1_responder, output, any_date):
 
    config = build_config(historical1_responder, any_date,
 
                          from_currency='ANG', to_currency='USD', amount=10,
 
                          ledger=True, denomination='USD')
...
 
@@ -140,5 +142,5 @@ def test_redundant_denomination(historical1_responder, output):
 

	
 
def test_from_denomination(historical1_responder, output):
 
    config = build_config(historical1_responder, from_currency='USD',
 
                          to_currency='ALL', amount=10,
 
def test_from_denomination(historical1_responder, output, any_date):
 
    config = build_config(historical1_responder, any_date,
 
                          from_currency='USD', to_currency='ALL', amount=10,
 
                          ledger=True, denomination='USD')
...
 
@@ -149,5 +151,5 @@ def test_from_denomination(historical1_responder, output):
 

	
 
def test_rate_precision_added_as_needed(historical1_responder, output):
 
    config = build_config(historical1_responder, from_currency='RUB',
 
                          to_currency='USD', amount=63805,
 
def test_rate_precision_added_as_needed(historical1_responder, output, any_date):
 
    config = build_config(historical1_responder, any_date,
 
                          from_currency='RUB', to_currency='USD', amount=63805,
 
                          ledger=True, denomination='USD')
0 comments (0 inline, 0 general)