Simplify tests by figuring out fixture dir automatically
We always use the same directory for terraform fixtures, so it's quite easy to figure out its path from a pytest fixture by inspecting the stack. This commit implements this functionality and decreases the amount of boilerplate needed to write a test. (Ported from fast)
This commit is contained in:
@@ -12,17 +12,12 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
import os
|
||||
import pytest
|
||||
|
||||
|
||||
FIXTURES_DIR = os.path.join(os.path.dirname(__file__), 'fixture')
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def resources(plan_runner):
|
||||
_, resources = plan_runner(FIXTURES_DIR)
|
||||
_, resources = plan_runner()
|
||||
return resources
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user