Skip to content

Commit

Permalink
[Tests] Refactoring.
Browse files Browse the repository at this point in the history
Add a conftest file to manage fixtures.
  • Loading branch information
hobbestigrou committed Mar 22, 2018
1 parent 02f0b0f commit 33f6927
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 34 deletions.
19 changes: 1 addition & 18 deletions tests/basic_json_test.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,8 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Simple basic test for JSON'''

"""Simple basic test for JSON"""
from __future__ import unicode_literals

import pytest

from pylocwolowitz import Pylocwolowitz

import os


@pytest.fixture
def pylocwolowitz():
"""To load the pylocwolowitz object"""
directory = os.getcwd() + '/i18n' if 'tests' in os.getcwd(
) else os.getcwd() + '/tests/i18n'
i18n = Pylocwolowitz(directory)

return i18n


def test_sample(pylocwolowitz):
"""Simple test no placeholders"""
Expand Down
17 changes: 1 addition & 16 deletions tests/basic_yaml_test.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Simple basic test to YAML'''
"""Simple basic test to YAML"""
from __future__ import unicode_literals
import os

import pytest

from pylocwolowitz import Pylocwolowitz


@pytest.fixture
def pylocwolowitz():
"""To load the pylocwolowitz object"""
directory = os.getcwd() + '/i18n' if 'tests' in os.getcwd(
) else os.getcwd() + '/tests/i18n'
i18n = Pylocwolowitz(directory, 'yaml')

return i18n


def test_sample(pylocwolowitz):
Expand Down
16 changes: 16 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
import os

import pytest

from pylocwolowitz import Pylocwolowitz


@pytest.fixture
def pylocwolowitz():
"""To load the pylocwolowitz object"""
directory = os.getcwd() + '/i18n' if 'tests' in os.getcwd(
) else os.getcwd() + '/tests/i18n'
i18n = Pylocwolowitz(directory, 'yaml')

return i18n

0 comments on commit 33f6927

Please sign in to comment.