|
10 | 10 | from decopatch import function_decorator, DECORATED |
11 | 11 | from makefun import with_signature, add_signature_parameters, remove_signature_parameters, wraps |
12 | 12 |
|
| 13 | +from six import string_types |
13 | 14 | import pytest |
14 | 15 |
|
15 | 16 | try: # python 3.3+ |
@@ -93,7 +94,7 @@ def _unpack_fixture(caller_module, argnames, fixture): |
93 | 94 | argnames_lst = get_param_argnames_as_list(argnames) |
94 | 95 |
|
95 | 96 | # possibly get the source fixture name if the fixture symbol was provided |
96 | | - if not isinstance(fixture, str): |
| 97 | + if not isinstance(fixture, string_types): |
97 | 98 | source_f_name = get_fixture_name(fixture) |
98 | 99 | scope = get_fixture_scope(fixture) |
99 | 100 | else: |
@@ -846,7 +847,7 @@ def _fixture_union(caller_module, name, fixtures, idstyle, scope="function", ids |
846 | 847 | f_names = [] |
847 | 848 | for f in fixtures: |
848 | 849 | # possibly get the fixture name if the fixture symbol was provided |
849 | | - f_names.append(get_fixture_name(f) if not isinstance(f, str) else f) |
| 850 | + f_names.append(get_fixture_name(f) if not isinstance(f, string_types) else f) |
850 | 851 |
|
851 | 852 | if len(f_names) < 1: |
852 | 853 | raise ValueError("Empty fixture unions are not permitted") |
@@ -916,7 +917,7 @@ def _fixture_product(caller_module, name, fixtures_or_values, fixture_positions, |
916 | 917 | # possibly get the fixture name if the fixture symbol was provided |
917 | 918 | f = fixtures_or_values[f_pos] |
918 | 919 | # and remember the position in the tuple |
919 | | - f_names[f_pos] = get_fixture_name(f) if not isinstance(f, str) else f |
| 920 | + f_names[f_pos] = get_fixture_name(f) if not isinstance(f, string_types) else f |
920 | 921 |
|
921 | 922 | # remove duplicates by making it an ordered set |
922 | 923 | all_names = remove_duplicates((n for n in f_names if n is not None)) |
|
0 commit comments