
import pytest


@pytest.yield_fixture
def tmpfile(request, tmpdir):
    yield tmpdir.join('file.tmp').ensure().strpath


import pytest

from blox.file import File


@pytest.yield_fixture
def tmpfile(request, tmpdir):
    filename = tmpdir.join('file.tmp').ensure().strpath
    File(filename, 'w').close()
    yield filename

Create a valid blox file in tmpfile fixture
Create a valid blox file in tmpfile fixture

  
  import pytest
+ 
+ from blox.file import File
  
  
  @pytest.yield_fixture
  def tmpfile(request, tmpdir):
-     yield tmpdir.join('file.tmp').ensure().strpath
+     filename = tmpdir.join('file.tmp').ensure().strpath
+     File(filename, 'w').close()
+     yield filename
  
Create a valid blox file in tmpfile fixture
## Code Before:

import pytest


@pytest.yield_fixture
def tmpfile(request, tmpdir):
    yield tmpdir.join('file.tmp').ensure().strpath

## Instruction:
Create a valid blox file in tmpfile fixture
## Code After:

import pytest

from blox.file import File


@pytest.yield_fixture
def tmpfile(request, tmpdir):
    filename = tmpdir.join('file.tmp').ensure().strpath
    File(filename, 'w').close()
    yield filename
