Skip to content

Commit

Permalink
Don't mess with global state
Browse files Browse the repository at this point in the history
  • Loading branch information
xyu committed Feb 17, 2022
1 parent 905fefd commit 027a758
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/core/test_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
import copy
import io
import os
import re
Expand Down Expand Up @@ -771,10 +772,8 @@ def test_enum_logging_levels(self):
assert message == exception

def test_as_dict_works_without_sensitive_cmds(self):
test_conf = conf

conf_materialize_cmds = test_conf.as_dict(display_sensitive=True, raw=True, include_cmds=True)
conf_maintain_cmds = test_conf.as_dict(display_sensitive=True, raw=True, include_cmds=False)
conf_materialize_cmds = conf.as_dict(display_sensitive=True, raw=True, include_cmds=True)
conf_maintain_cmds = conf.as_dict(display_sensitive=True, raw=True, include_cmds=False)

assert 'sql_alchemy_conn' in conf_materialize_cmds['core']
assert 'sql_alchemy_conn_cmd' not in conf_materialize_cmds['core']
Expand All @@ -789,7 +788,7 @@ def test_as_dict_works_without_sensitive_cmds(self):

def test_as_dict_respects_sensitive_cmds(self):
conf_conn = conf['core']['sql_alchemy_conn']
test_conf = conf
test_conf = copy.copy(conf)
test_conf.read_string(
textwrap.dedent(
"""
Expand Down

0 comments on commit 027a758

Please sign in to comment.