title: Python: File not found from tests
body: <p>I've got an application which uses files of configurations for example and If I run the application all these files are found and there is no problem, but If I do it from my tests I've got this error:</p>
  <pre><code>Error
  Traceback (most recent call last):
    File &quot;/usr/lib/python3.6/unittest/case.py&quot;, line 59, in testPartExecutor
      yield
    File &quot;/usr/lib/python3.6/unittest/case.py&quot;, line 605, in run
      testMethod()
    File &quot;/home/josecarlos/Workspace/python/reports/test/data_test.py&quot;, line 50, in test_players_teams_ss
      data = Data(params)
    File &quot;/home/josecarlos/Workspace/python/reports/com/data.py&quot;, line 10, in __init__
      self.home_standard_stats = self.team_standard_stats(params[&quot;home&quot;], params[&quot;league&quot;])
    File &quot;/home/josecarlos/Workspace/python/reports/com/data.py&quot;, line 53, in team_standard_stats
      id_season = self.get_id_season(id_league)
    File &quot;/home/josecarlos/Workspace/python/reports/com/data.py&quot;, line 27, in get_id_season
      db = SearchData(args, &quot;season=&quot;)
    File &quot;/home/josecarlos/Workspace/python/reports/ddbb/feb/data/search.py&quot;, line 18, in __init__
      q = query.getQuery(query_name)
    File &quot;/home/josecarlos/Workspace/python/reports/com/files/queryreader.py&quot;, line 14, in getQuery
      with open(self.getURL()) as file:
  FileNotFoundError: [Errno 2] No such file or directory: './files/querys.sql'
  </code></pre>
  <p>This is my test file, <strong>data_test.py</strong></p>
  <pre><code>import unittest
  from com.data import Data
  from constants import COMPETITIONS
  import os
  
  class TestDataMethods(unittest.TestCase):
      def test_season(self):
          #os.chdir(&quot;../&quot;) #We need to do this to go to the main directory of the app. If we don't do this, the code will run over ./test
          params = {&quot;report&quot; : 1, &quot;league&quot; : COMPETITIONS.LF1, &quot;home&quot;: 771, &quot;away&quot;: 775}
          season = Data.get_id_season(params[&quot;league&quot;])
  
      def test_team_standard_stats(self):
          #os.chdir(&quot;../&quot;)
          params = {&quot;report&quot; : 1, &quot;league&quot; : COMPETITIONS.LF1, &quot;home&quot;: 771, &quot;away&quot;: 775}
          data = Data(params)
          home_tss = data.home_standard_stats
          self.assertEqual(home_tss.get_result().getTotalRows(), 1, &quot;Error al devolver datos. No se devuelve 1 única fila de datos&quot;)
          self.assertEqual(int(home_tss.get_result().getData()[0][&quot;t2p_int&quot;]), 952, &quot;Error al devolver el número de t2p_int&quot;)
          self.assertEqual(float(home_tss.get_result().getData()[0][&quot;t2p_percentage&quot;]), 43.38, &quot;Error al devolver el número de t2p_percentage&quot;)
          self.assertEqual(float(home_tss.get_result().getData()[0][&quot;ppa&quot;]), 0.84, &quot;Error al devolver los puntos por intento del equipo&quot;)
          params = {&quot;report&quot; : 1, &quot;league&quot; : COMPETITIONS.EUROLEAGUE, &quot;home&quot;: 79, &quot;away&quot;: 93}
          data = Data(params)
          home_tss = data.home_standard_stats
          self.assertEqual(home_tss.get_result().getTotalRows(), 1, &quot;Error al devolver datos. No se devuelve 1 única fila de datos&quot;)
          self.assertEqual(int(home_tss.get_result().getData()[0][&quot;t2p_int&quot;]), 848, &quot;Error al devolver el número de t2p_int&quot;)
          self.assertEqual(float(home_tss.get_result().getData()[0][&quot;t2p_percentage&quot;]), 49.53, &quot;Error al devolver el número de t2p_percentage&quot;)
          self.assertEqual(float(home_tss.get_result().getData()[0][&quot;ppa&quot;]), 0.92, &quot;Error al devolver los puntos por intento del equipo&quot;)
  
      def test_team_advanced_stats(self):
          #os.chdir(&quot;../&quot;)
          params = {&quot;report&quot;: 1, &quot;league&quot;: COMPETITIONS.LF1, &quot;home&quot;: 770, &quot;away&quot;: 769}
          data = Data(params)
          home_tas = data.home_advanced_stats
          self.assertEqual(home_tas.get_result().getTotalRows(), 1, &quot;Local:: Error al devolver datos. No se devuelve 1 única fila de datos&quot;)
          self.assertEqual(float(home_tas.get_result().getData()[0][&quot;ortg&quot;]), 109.08, &quot;Local:: Error al devolver el ORTG&quot;)
          params = {&quot;report&quot;: 1, &quot;league&quot;: COMPETITIONS.LF1, &quot;home&quot;: 770, &quot;away&quot;: 769}
          data = Data(params)
          away_tas = data.away_advanced_stats
          self.assertEqual(away_tas.get_result().getTotalRows(), 1, &quot;Visitante:: Error al devolver datos. No se devuelve 1 única fila de datos&quot;)
          self.assertEqual(float(away_tas.get_result().getData()[0][&quot;drtg&quot;]), 81.96, &quot;Visitante: Error al deveolver el DRTG&quot;)
          params = {&quot;report&quot;: 1, &quot;league&quot;: COMPETITIONS.EUROLEAGUE, &quot;home&quot;: 79, &quot;away&quot;: 93}
          data = Data(params)
          away_tas = data.away_advanced_stats
          self.assertEqual(away_tas.get_result().getTotalRows(), 1, &quot;Visitante:: Error al devolver datos. No se devuelve 1 única fila de datos&quot;)
          self.assertEqual(float(away_tas.get_result().getData()[0][&quot;drtg&quot;]), 106.25, &quot;Visitante: Error al deveolver el DRTG&quot;)
  
      def test_players_teams_ss(self):
          #os.chdir(&quot;../&quot;)
          params = {&quot;report&quot; : 1, &quot;league&quot; : COMPETITIONS.LF1, &quot;home&quot;: 770, &quot;away&quot;: 769}
          data = Data(params)
          home_pt_ss = data.players_team_ss(params[&quot;home&quot;], params[&quot;league&quot;])
          self.assertEqual(home_pt_ss.get_result().getTotalRows(), 13, &quot;Error: Número de registros recibido no es correcto&quot;)
          self.assertEqual(home_pt_ss.get_result().getData()[8][&quot;numero&quot;], 44, &quot;Error: El número de la jugadora no es correcto&quot;)
          self.assertEqual(float(home_pt_ss.get_result().getData()[3][&quot;t2p_percentage&quot;]), 55.03, &quot;Error: El porcentaje de acierto de T2P no es correcto&quot;)
          params = {&quot;report&quot; : 1, &quot;league&quot; : COMPETITIONS.LF1, &quot;home&quot;: 770, &quot;away&quot;: 769}
          data = Data(params)
          away_pt_ss = data.players_team_ss(params[&quot;away&quot;], params[&quot;league&quot;])
          self.assertEqual(away_pt_ss.get_result().getTotalRows(), 15, &quot;Error: Número de registros recibido no es correcto&quot;)
          self.assertEqual(away_pt_ss.get_result().getData()[8][&quot;numero&quot;], 3, &quot;Error: El número de la jugadora no es correcto&quot;)
          self.assertEqual(float(away_pt_ss.get_result().getData()[3][&quot;t2p_percentage&quot;]), 37.25, &quot;Error: El porcentaje de acierto de T2P no es correcto&quot;)
  
  
      def test_players_teams_as(self):
          pass
  
  
  if __name__== &quot;__main__&quot;:
      unittest.main()
  </code></pre>
  <p>And this is the file over we run the test, <strong>data.py</strong></p>
  <pre><code>from ddbb.fiba.data.search import SearchDataFIBA
  from ddbb.feb.data.search import SearchData
  from constants import COMPETITIONS, SEASONS
  
  
  class Data():
      def __init__(self, params):
          self.params = params
          #Recuperar datos de estadísticas estandard del equipo local y visitante
          self.home_standard_stats = self.team_standard_stats(params[&quot;home&quot;], params[&quot;league&quot;])
          self.away_standard_stats = self.team_standard_stats(params[&quot;away&quot;], params[&quot;league&quot;])
          #Recuperar datos de estadísticas avanzadas del equipo local y visitante
          self.home_advanced_stats = self.team_advanced_stats(params[&quot;home&quot;], params[&quot;league&quot;])
          self.away_advanced_stats = self.team_advanced_stats(params[&quot;away&quot;], params[&quot;league&quot;])
          #Recuperar datos de estadísticas estandard y avanzadas del las jugadoras del equipo local y visitante
          self.home_pt_ss = self.players_team_ss(params[&quot;home&quot;], params[&quot;league&quot;])
          #self.away_pt_ss = self.players_team_ss(params[&quot;away&quot;], params[&quot;league&quot;])
          #Recuperar datos de estadísticas estandard y avanzadas de las jugadoras del equipo local y visitante
          self.home_pt_as = self.players_team_as(params[&quot;home&quot;], params[&quot;league&quot;])
          self.away_pt_as = self.players_team_as(params[&quot;away&quot;], params[&quot;league&quot;])
  
      @staticmethod
      def get_id_season(league):
          '''Returns id season of the current season for the league passed like parameter'''
          if league == COMPETITIONS.LF1:
              args = [1]
              db = SearchData(args, &quot;season=&quot;)
              return db.get_result().getData()[0][&quot;id&quot;]
          if league == COMPETITIONS.LF2:
              args = [2]
              db = SearchData(args, &quot;season=&quot;)
              return db.get_result().getData()[0][&quot;id&quot;]
          if league == COMPETITIONS.EUROLEAGUE:
              args = [1]
              db = SearchDataFIBA(args, &quot;season=&quot;)
              return db.get_result().getData()[0][&quot;id&quot;]
          if league == COMPETITIONS.EUROCUP:
              args = [2]
              db = SearchDataFIBA(args, &quot;season=&quot;)
              return db.get_result().getData()[0][&quot;id&quot;]
  
      def team_advanced_stats(self, id_team, id_league):
          '''Return the advanced stats from a team in a whole season'''
          id_season = self.get_id_season(id_league)
          args = [id_team, id_team, id_season, id_team, id_team]
          if id_league == COMPETITIONS.LF1 or id_league == COMPETITIONS.LF2:
              return SearchData(args, &quot;team.adv.stats=&quot;)
          if id_league == COMPETITIONS.EUROLEAGUE or id_league == COMPETITIONS.EUROLEAGUE:
              return SearchDataFIBA(args, &quot;team.adv.stats=&quot;)
  
      def team_standard_stats(self, id_team, id_league):
          '''Return the standard stats from a team in a whole season'''
          id_season = self.get_id_season(id_league)
          args = [id_team, id_season]
          if id_league == COMPETITIONS.LF1 or id_league == COMPETITIONS.LF2:
              return SearchData(args, &quot;team.std.stats=&quot;)
          if id_league == COMPETITIONS.EUROLEAGUE or id_league == COMPETITIONS.EUROCUP:
              return  SearchDataFIBA(args, &quot;team.std.stats=&quot;)
  
      @staticmethod
      def players_team_ss(id_team, id_league):
          '''Return standard stats of all the players of a team for a whole season'''
          args = [id_team]
          if id_league == COMPETITIONS.LF1 or id_league == COMPETITIONS.LF2:
              return SearchData(args, &quot;feb.players.std.stats=&quot;)
          if id_league == COMPETITIONS.EUROLEAGUE or id_league == COMPETITIONS.EUROCUP:
              return SearchDataFIBA(args, &quot;fiba.players.std.stats=&quot;)
  
      @staticmethod
      def players_team_as(id_team, id_league):
          '''Returns advanced stats of all the players of a team for a whole season'''
          args = [id_team]
          if id_league == COMPETITIONS.LF1 or id_league == COMPETITIONS.LF2:
              return SearchData(args, &quot;feb.players.adv.stats=&quot;)
          if id_league == COMPETITIONS.EUROLEAGUE or id_league == COMPETITIONS.EUROCUP:
              return SearchDataFIBA(args, &quot;fiba.players.adv.stats=&quot;)
  </code></pre>
  <p>And this my structure of folders in the project:</p>
  <p><a href="https://i.stack.imgur.com/sYCwk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sYCwk.png" alt="enter image description here" /></a></p>
  <p>What can I do to find the file?</p>
  <p><strong>Edit I</strong></p>
  <p>I have added this line to my code in test_sesion <em>&quot;os.chdir('../')&quot;</em></p>
  <p>The method right now is:</p>
  <pre><code>def test_season(self):
      os.chdir(&quot;../&quot;) #We need to do this to go to the main directory of the app. If we don't do this, the code will run over ./test
      params = {&quot;report&quot; : 1, &quot;league&quot; : COMPETITIONS.LF1, &quot;home&quot;: 771, &quot;away&quot;: 775}
      season = Data.get_id_season(params[&quot;league&quot;])
  </code></pre>
  <p>This method access to data base and to do this needs to access fhe file /files/querys.sql and the test works fine!!!</p>
  <p>If I run the test but adding the method tests <em>test_team_standard_stats</em> and <em>test_team_advanced_stats</em> the code of the test file is:</p>
  <pre><code>import unittest
  from com.data import Data
  from constants import COMPETITIONS
  import os
  
  class TestDataMethods(unittest.TestCase):
      def test_season(self):
          os.chdir(&quot;../&quot;) #We need to do this to go to the main directory of the app. If we don't do this, the code will run over ./test
          params = {&quot;report&quot; : 1, &quot;league&quot; : COMPETITIONS.LF1, &quot;home&quot;: 771, &quot;away&quot;: 775}
          season = Data.get_id_season(params[&quot;league&quot;])
  
      def test_team_standard_stats(self):
          #os.chdir(&quot;../&quot;)
          params = {&quot;report&quot; : 1, &quot;league&quot; : COMPETITIONS.LF1, &quot;home&quot;: 771, &quot;away&quot;: 775}
          data = Data(params)
          home_tss = data.home_standard_stats
          self.assertEqual(home_tss.get_result().getTotalRows(), 1, &quot;Error al devolver datos. No se devuelve 1 única fila de datos&quot;)
          self.assertEqual(int(home_tss.get_result().getData()[0][&quot;t2p_int&quot;]), 952, &quot;Error al devolver el número de t2p_int&quot;)
          self.assertEqual(float(home_tss.get_result().getData()[0][&quot;t2p_percentage&quot;]), 43.38, &quot;Error al devolver el número de t2p_percentage&quot;)
          self.assertEqual(float(home_tss.get_result().getData()[0][&quot;ppa&quot;]), 0.84, &quot;Error al devolver los puntos por intento del equipo&quot;)
          params = {&quot;report&quot; : 1, &quot;league&quot; : COMPETITIONS.EUROLEAGUE, &quot;home&quot;: 79, &quot;away&quot;: 93}
          data = Data(params)
          home_tss = data.home_standard_stats
          self.assertEqual(home_tss.get_result().getTotalRows(), 1, &quot;Error al devolver datos. No se devuelve 1 única fila de datos&quot;)
          self.assertEqual(int(home_tss.get_result().getData()[0][&quot;t2p_int&quot;]), 848, &quot;Error al devolver el número de t2p_int&quot;)
          self.assertEqual(float(home_tss.get_result().getData()[0][&quot;t2p_percentage&quot;]), 49.53, &quot;Error al devolver el número de t2p_percentage&quot;)
          self.assertEqual(float(home_tss.get_result().getData()[0][&quot;ppa&quot;]), 0.92, &quot;Error al devolver los puntos por intento del equipo&quot;)
  
      def test_team_advanced_stats(self):
          params = {&quot;report&quot;: 1, &quot;league&quot;: COMPETITIONS.LF1, &quot;home&quot;: 770, &quot;away&quot;: 769}
          data = Data(params)
          home_tas = data.home_advanced_stats
          self.assertEqual(home_tas.get_result().getTotalRows(), 1, &quot;Local:: Error al devolver datos. No se devuelve 1 única fila de datos&quot;)
          self.assertEqual(float(home_tas.get_result().getData()[0][&quot;ortg&quot;]), 109.08, &quot;Local:: Error al devolver el ORTG&quot;)
          params = {&quot;report&quot;: 1, &quot;league&quot;: COMPETITIONS.LF1, &quot;home&quot;: 770, &quot;away&quot;: 769}
          data = Data(params)
          away_tas = data.away_advanced_stats
          self.assertEqual(away_tas.get_result().getTotalRows(), 1, &quot;Visitante:: Error al devolver datos. No se devuelve 1 única fila de datos&quot;)
          self.assertEqual(float(away_tas.get_result().getData()[0][&quot;drtg&quot;]), 81.96, &quot;Visitante: Error al deveolver el DRTG&quot;)
          params = {&quot;report&quot;: 1, &quot;league&quot;: COMPETITIONS.EUROLEAGUE, &quot;home&quot;: 79, &quot;away&quot;: 93}
          data = Data(params)
          away_tas = data.away_advanced_stats
          self.assertEqual(away_tas.get_result().getTotalRows(), 1, &quot;Visitante:: Error al devolver datos. No se devuelve 1 única fila de datos&quot;)
          self.assertEqual(float(away_tas.get_result().getData()[0][&quot;drtg&quot;]), 106.25, &quot;Visitante: Error al deveolver el DRTG&quot;)
  
      # def test_players_teams_ss(self):
      #     params = {&quot;report&quot; : 1, &quot;league&quot; : COMPETITIONS.LF1, &quot;home&quot;: 770, &quot;away&quot;: 769}
      #     data = Data(params)
      #     home_pt_ss = data.players_team_ss(params[&quot;home&quot;], params[&quot;league&quot;])
      #     self.assertEqual(home_pt_ss.get_result().getTotalRows(), 13, &quot;Error: Número de registros recibido no es correcto&quot;)
      #     self.assertEqual(home_pt_ss.get_result().getData()[8][&quot;numero&quot;], 44, &quot;Error: El número de la jugadora no es correcto&quot;)
      #     self.assertEqual(float(home_pt_ss.get_result().getData()[3][&quot;t2p_percentage&quot;]), 55.03, &quot;Error: El porcentaje de acierto de T2P no es correcto&quot;)
      #     params = {&quot;report&quot; : 1, &quot;league&quot; : COMPETITIONS.LF1, &quot;home&quot;: 770, &quot;away&quot;: 769}
      #     data = Data(params)
      #     away_pt_ss = data.players_team_ss(params[&quot;away&quot;], params[&quot;league&quot;])
      #     self.assertEqual(away_pt_ss.get_result().getTotalRows(), 15, &quot;Error: Número de registros recibido no es correcto&quot;)
      #     self.assertEqual(away_pt_ss.get_result().getData()[8][&quot;numero&quot;], 3, &quot;Error: El número de la jugadora no es correcto&quot;)
      #     self.assertEqual(float(away_pt_ss.get_result().getData()[3][&quot;t2p_percentage&quot;]), 37.25, &quot;Error: El porcentaje de acierto de T2P no es correcto&quot;)
  
      #
      # def test_players_teams_as(self):
      #     pass
  
  
  if __name__== &quot;__main__&quot;:
      unittest.main()
  </code></pre>
  <p>¡¡¡The test works fine!!!</p>
  <p>But if I add the method <em>test_players_teams_ss</em> to the test then this doesn't work :( I don't understand anything :(</p>
  <pre><code>Error
  Traceback (most recent call last):
    File &quot;/usr/lib/python3.6/unittest/case.py&quot;, line 59, in testPartExecutor
      yield
    File &quot;/usr/lib/python3.6/unittest/case.py&quot;, line 605, in run
      testMethod()
    File &quot;/home/josecarlos/Workspace/python/reports/test/data_test.py&quot;, line 10, in test_season
      season = Data.get_id_season(params[&quot;league&quot;])
    File &quot;/home/josecarlos/Workspace/python/reports/com/data.py&quot;, line 27, in get_id_season
      db = SearchData(args, &quot;season=&quot;)
    File &quot;/home/josecarlos/Workspace/python/reports/ddbb/feb/data/search.py&quot;, line 18, in __init__
      q = query.getQuery(query_name)
    File &quot;/home/josecarlos/Workspace/python/reports/com/files/queryreader.py&quot;, line 14, in getQuery
      with open(self.getURL()) as file:
  FileNotFoundError: [Errno 2] No such file or directory: './files/querys.sql'
  </code></pre>
  <p>How it does possible?</p>
  <p><strong>Edit II:</strong></p>
  <p>I have made more tests over my test file and I don't understand anything. I have commented all the code except the code of the method test <em>test_players_teams_ss</em> I remember that this test didn't work before. Ok, I have added this line to the method <em>os.chdir('../')</em></p>
  <p>The code of the method is:</p>
  <pre><code>def test_players_teams_ss(self):
      os.chdir(&quot;../&quot;)
      params = {&quot;report&quot; : 1, &quot;league&quot; : COMPETITIONS.LF1, &quot;home&quot;: 770, &quot;away&quot;: 769}
      data = Data(params)
      home_pt_ss = data.players_team_ss(params[&quot;home&quot;], params[&quot;league&quot;])
      self.assertEqual(home_pt_ss.get_result().getTotalRows(), 13, &quot;Error: Número de registros recibido no es correcto&quot;)
      self.assertEqual(home_pt_ss.get_result().getData()[8][&quot;numero&quot;], 44, &quot;Error: El número de la jugadora no es correcto&quot;)
      self.assertEqual(float(home_pt_ss.get_result().getData()[3][&quot;t2p_percentage&quot;]), 55.03, &quot;Error: El porcentaje de acierto de T2P no es correcto&quot;)
      params = {&quot;report&quot; : 1, &quot;league&quot; : COMPETITIONS.LF1, &quot;home&quot;: 770, &quot;away&quot;: 769}
      data = Data(params)
      away_pt_ss = data.players_team_ss(params[&quot;away&quot;], params[&quot;league&quot;])
      self.assertEqual(away_pt_ss.get_result().getTotalRows(), 15, &quot;Error: Número de registros recibido no es correcto&quot;)
      self.assertEqual(away_pt_ss.get_result().getData()[8][&quot;numero&quot;], 3, &quot;Error: El número de la jugadora no es correcto&quot;)
      self.assertEqual(float(away_pt_ss.get_result().getData()[3][&quot;t2p_percentage&quot;]), 37.25, &quot;Error: El porcentaje de acierto de T2P no es correcto&quot;)
  </code></pre>
  <p>If I run the test with this only method the test ... works fine!!!</p>
  <p>Then, If I uncomment the rest of the code of the other methods and run the test this ... doesn't work!!!</p>
  <pre><code>Error
  Traceback (most recent call last):
    File &quot;/usr/lib/python3.6/unittest/case.py&quot;, line 59, in testPartExecutor
      yield
    File &quot;/usr/lib/python3.6/unittest/case.py&quot;, line 605, in run
      testMethod()
    File &quot;/home/josecarlos/Workspace/python/reports/test/data_test.py&quot;, line 10, in test_season
      season = Data.get_id_season(params[&quot;league&quot;])
    File &quot;/home/josecarlos/Workspace/python/reports/com/data.py&quot;, line 27, in get_id_season
      db = SearchData(args, &quot;season=&quot;)
    File &quot;/home/josecarlos/Workspace/python/reports/ddbb/feb/data/search.py&quot;, line 18, in __init__
      q = query.getQuery(query_name)
    File &quot;/home/josecarlos/Workspace/python/reports/com/files/queryreader.py&quot;, line 14, in getQuery
      with open(self.getURL()) as file:
  FileNotFoundError: [Errno 2] No such file or directory: './files/querys.sql'
  
  
  Error
  Traceback (most recent call last):
    File &quot;/usr/lib/python3.6/unittest/case.py&quot;, line 59, in testPartExecutor
      yield
    File &quot;/usr/lib/python3.6/unittest/case.py&quot;, line 605, in run
      testMethod()
    File &quot;/home/josecarlos/Workspace/python/reports/test/data_test.py&quot;, line 32, in test_team_advanced_stats
      data = Data(params)
    File &quot;/home/josecarlos/Workspace/python/reports/com/data.py&quot;, line 10, in __init__
      self.home_standard_stats = self.team_standard_stats(params[&quot;home&quot;], params[&quot;league&quot;])
    File &quot;/home/josecarlos/Workspace/python/reports/com/data.py&quot;, line 53, in team_standard_stats
      id_season = self.get_id_season(id_league)
    File &quot;/home/josecarlos/Workspace/python/reports/com/data.py&quot;, line 27, in get_id_season
      db = SearchData(args, &quot;season=&quot;)
    File &quot;/home/josecarlos/Workspace/python/reports/ddbb/feb/data/search.py&quot;, line 18, in __init__
      q = query.getQuery(query_name)
    File &quot;/home/josecarlos/Workspace/python/reports/com/files/queryreader.py&quot;, line 14, in getQuery
      with open(self.getURL()) as file:
  FileNotFoundError: [Errno 2] No such file or directory: './files/querys.sql'
  
  
  Error
  Traceback (most recent call last):
    File &quot;/usr/lib/python3.6/unittest/case.py&quot;, line 59, in testPartExecutor
      yield
    File &quot;/usr/lib/python3.6/unittest/case.py&quot;, line 605, in run
      testMethod()
    File &quot;/home/josecarlos/Workspace/python/reports/test/data_test.py&quot;, line 15, in test_team_standard_stats
      data = Data(params)
    File &quot;/home/josecarlos/Workspace/python/reports/com/data.py&quot;, line 10, in __init__
      self.home_standard_stats = self.team_standard_stats(params[&quot;home&quot;], params[&quot;league&quot;])
    File &quot;/home/josecarlos/Workspace/python/reports/com/data.py&quot;, line 53, in team_standard_stats
      id_season = self.get_id_season(id_league)
    File &quot;/home/josecarlos/Workspace/python/reports/com/data.py&quot;, line 27, in get_id_season
      db = SearchData(args, &quot;season=&quot;)
    File &quot;/home/josecarlos/Workspace/python/reports/ddbb/feb/data/search.py&quot;, line 18, in __init__
      q = query.getQuery(query_name)
    File &quot;/home/josecarlos/Workspace/python/reports/com/files/queryreader.py&quot;, line 14, in getQuery
      with open(self.getURL()) as file:
  FileNotFoundError: [Errno 2] No such file or directory: './files/querys.sql'
  </code></pre>
  <p>Really, I don't understand anything, it's a madness!!!</p>