From 0c0e591cb749663e949284b94eae8ad6b3db0146 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Tue, 11 Jun 2019 13:54:13 -0400 Subject: [PATCH] Simple changes to address reviewer comments Re-organize some imports, use run_in_tmpdir fixture, use FutureWarning over DeprecationWarning --- openmc/deplete/abc.py | 2 +- tests/unit_tests/test_deplete_operator.py | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/openmc/deplete/abc.py b/openmc/deplete/abc.py index d25d1d74f2..226877c149 100644 --- a/openmc/deplete/abc.py +++ b/openmc/deplete/abc.py @@ -80,7 +80,7 @@ class TransportOperator(metaclass=ABCMeta): else: warn("Use of OPENMC_DEPLETE_CHAIN is deprecated in favor " "of adding depletion_chain to OPENMC_CROSS_SECTIONS", - DeprecationWarning) + FutureWarning) self.chain = Chain.from_xml(chain_file) @abstractmethod diff --git a/tests/unit_tests/test_deplete_operator.py b/tests/unit_tests/test_deplete_operator.py index c188ec94c2..757b51d923 100644 --- a/tests/unit_tests/test_deplete_operator.py +++ b/tests/unit_tests/test_deplete_operator.py @@ -4,21 +4,20 @@ Modifies and resets environment variable OPENMC_CROSS_SECTIONS to a custom file with new depletion_chain node """ -from os import remove from os import environ from unittest import mock from pathlib import Path -import pytest +import pytest from openmc.deplete.abc import TransportOperator from openmc.deplete.chain import Chain BARE_XS_FILE = "bare_cross_sections.xml" -CHAIN_PATH = Path().cwd() / "tests" / "chain_simple.xml" +CHAIN_PATH = Path(__file__).parents[1] / "chain_simple.xml" -@pytest.fixture(scope="module") -def bare_xs(): +@pytest.fixture() +def bare_xs(run_in_tmpdir): """Create a very basic cross_sections file, return simple Chain. """ @@ -33,7 +32,6 @@ def bare_xs(): out.write(bare_xs_contents) yield - remove(BARE_XS_FILE) class BareDepleteOperator(TransportOperator):