Skip to content

Commit 81b5303

Browse files
authored
[MNT] remove import conditionals for python 3.6 (#1928)
removes import conditionals for `python 3.6` - 3.6 has been deprecated for years now.
1 parent 53ae520 commit 81b5303

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

tests/test_models/test_temporal_fusion_transformer.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from contextlib import nullcontext
12
import pickle
23
import shutil
34
import sys
@@ -8,6 +9,7 @@
89
import numpy as np
910
import pandas as pd
1011
import pytest
12+
from test_models.conftest import make_dataloaders
1113
import torch
1214

1315
from pytorch_forecasting import Baseline, TimeSeriesDataSet
@@ -29,18 +31,6 @@
2931
)
3032
from pytorch_forecasting.utils._dependencies import _get_installed_packages
3133

32-
if sys.version.startswith("3.6"): # python 3.6 does not have nullcontext
33-
from contextlib import contextmanager
34-
35-
@contextmanager
36-
def nullcontext(enter_result=None):
37-
yield enter_result
38-
39-
else:
40-
from contextlib import nullcontext
41-
42-
from test_models.conftest import make_dataloaders
43-
4434

4535
def test_integration(multiple_dataloaders_with_covariates, tmp_path):
4636
_integration(

0 commit comments

Comments
 (0)