Skip to content

Commit

Permalink
Pytest support (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
fcanobrash authored Aug 26, 2019
1 parent a5259ea commit 6efd798
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scrapy_autounit/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def write_test(path, test_name, fixture_name, encoding):

test_code = '''import unittest
from pathlib import Path
from scrapy_autounit.utils import test_generator
from scrapy_autounit.utils import generate_test
class AutoUnit(unittest.TestCase):
Expand All @@ -204,7 +204,7 @@ def test__{test_name}__{fixture_name}(self):
file_path = (
Path(__file__).parent / '{fixture_name}.bin'
)
test = test_generator(file_path.resolve(), '{encoding}')
test = generate_test(file_path.resolve(), '{encoding}')
test(self)
Expand Down Expand Up @@ -247,7 +247,7 @@ def binary_check(fx_obj, cb_obj, encoding):
return fx_obj


def test_generator(fixture_path, encoding='utf-8'):
def generate_test(fixture_path, encoding='utf-8'):
with open(str(fixture_path), 'rb') as f:
data = f.read()

Expand Down

0 comments on commit 6efd798

Please sign in to comment.