Files
@ 5a73d3d8f8d4
Branch filter:
Location: NPO-Accounting/oxrlib/tests/__init__.py - annotation
5a73d3d8f8d4
518 B
text/x-python
historical: Move normalize_rate and _pretty_rate to base Formatter.
This reduces the number of method overrides to help readability,
and gets rid of the annoying format_rate/pretty_rate distinction.
This reduces the number of method overrides to help readability,
and gets rid of the annoying format_rate/pretty_rate distinction.
1927a1812033 a3cc41a5cfea 6a416b162d8a a1811663115e 1927a1812033 1927a1812033 1927a1812033 a1811663115e a3cc41a5cfea a3cc41a5cfea a3cc41a5cfea a3cc41a5cfea a1811663115e a1811663115e 6a416b162d8a 6a416b162d8a 6a416b162d8a 6a416b162d8a 6a416b162d8a d1ba2dbc6a33 d1ba2dbc6a33 1927a1812033 1927a1812033 1927a1812033 1927a1812033 | import datetime
import decimal
import io
import pathlib
import random
import pytest
from oxrlib import __main__ as oxrmain
decimal.setcontext(oxrmain.decimal_context())
TEST_DIR = pathlib.Path(__file__).parent
class StringIO(io.StringIO):
def close(self):
self.last_value = self.getvalue()
super().close()
def relpath(*parts):
return TEST_DIR / pathlib.Path(*parts)
@pytest.fixture
def any_date():
return datetime.date.today() - datetime.timedelta(days=730 - random.randint(0, 365))
|