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:
Julio Castillo
2022-01-10 23:29:15 +01:00
parent 78102b2acf
commit f0773d4883
74 changed files with 191 additions and 701 deletions

View File

@@ -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