
import pytest

from asdf.tests.helpers import assert_roundtrip_tree

from astropy.time import Time


@pytest.mark.parametrize('fmt', Time.FORMATS.keys())
def test_timedelta(fmt, tmpdir):

    t1 = Time(Time.now(), format=fmt)
    t2 = Time(Time.now(), format=fmt)

    td = t2 - t1
    tree = dict(timedelta=td)
    assert_roundtrip_tree(tree, tmpdir)


import pytest

asdf = pytest.importorskip('asdf')
from asdf.tests.helpers import assert_roundtrip_tree

from astropy.time import Time


@pytest.mark.parametrize('fmt', Time.FORMATS.keys())
def test_timedelta(fmt, tmpdir):

    t1 = Time(Time.now(), format=fmt)
    t2 = Time(Time.now(), format=fmt)

    td = t2 - t1
    tree = dict(timedelta=td)
    assert_roundtrip_tree(tree, tmpdir)

Add importorskip('asdf') to test for TimeDelta tag
Add importorskip('asdf') to test for TimeDelta tag

  
  import pytest
  
+ asdf = pytest.importorskip('asdf')
  from asdf.tests.helpers import assert_roundtrip_tree
  
  from astropy.time import Time
  
  
  @pytest.mark.parametrize('fmt', Time.FORMATS.keys())
  def test_timedelta(fmt, tmpdir):
  
      t1 = Time(Time.now(), format=fmt)
      t2 = Time(Time.now(), format=fmt)
  
      td = t2 - t1
      tree = dict(timedelta=td)
      assert_roundtrip_tree(tree, tmpdir)
  
Add importorskip('asdf') to test for TimeDelta tag
## Code Before:

import pytest

from asdf.tests.helpers import assert_roundtrip_tree

from astropy.time import Time


@pytest.mark.parametrize('fmt', Time.FORMATS.keys())
def test_timedelta(fmt, tmpdir):

    t1 = Time(Time.now(), format=fmt)
    t2 = Time(Time.now(), format=fmt)

    td = t2 - t1
    tree = dict(timedelta=td)
    assert_roundtrip_tree(tree, tmpdir)

## Instruction:
Add importorskip('asdf') to test for TimeDelta tag
## Code After:

import pytest

asdf = pytest.importorskip('asdf')
from asdf.tests.helpers import assert_roundtrip_tree

from astropy.time import Time


@pytest.mark.parametrize('fmt', Time.FORMATS.keys())
def test_timedelta(fmt, tmpdir):

    t1 = Time(Time.now(), format=fmt)
    t2 = Time(Time.now(), format=fmt)

    td = t2 - t1
    tree = dict(timedelta=td)
    assert_roundtrip_tree(tree, tmpdir)
