I frequently write test suites in different files. Then I have a main test file 
which imports all suites. One example from emmy 
<https://github.com/unicredit/emmy>_ looks like this:
    
    
    import tstructures, tpairs, toperations, ttableops, tmodular, tfractions,
      tpolynomials, tlinear, tprimality, tintegers_modulo, tfinite_fields,
      tnormal_forms
    
    
    Run

The problem is that I get a lot of warnings like
    
    
    /Users/andrea/progetti/emmy/tests/all.nim(16, 8) Warning: imported and not 
used: 'tstructures' [UnusedImport]
    /Users/andrea/progetti/emmy/tests/all.nim(16, 21) Warning: imported and not 
used: 'tpairs' [UnusedImport]
    /Users/andrea/progetti/emmy/tests/all.nim(16, 29) Warning: imported and not 
used: 'toperations' [UnusedImport]
    /Users/andrea/progetti/emmy/tests/all.nim(16, 42) Warning: imported and not 
used: 'ttableops' [UnusedImport]
    /Users/andrea/progetti/emmy/tests/all.nim(16, 53) Warning: imported and not 
used: 'tmodular' [UnusedImport]
    /Users/andrea/progetti/emmy/tests/all.nim(16, 63) Warning: imported and not 
used: 'tfractions' [UnusedImport]
    /Users/andrea/progetti/emmy/tests/all.nim(17, 3) Warning: imported and not 
used: 'tpolynomials' [UnusedImport]
    /Users/andrea/progetti/emmy/tests/all.nim(17, 17) Warning: imported and not 
used: 'tlinear' [UnusedImport]
    /Users/andrea/progetti/emmy/tests/all.nim(17, 26) Warning: imported and not 
used: 'tprimality' [UnusedImport]
    /Users/andrea/progetti/emmy/tests/all.nim(17, 38) Warning: imported and not 
used: 'tintegers_modulo' [UnusedImport]
    /Users/andrea/progetti/emmy/tests/all.nim(17, 56) Warning: imported and not 
used: 'tfinite_fields' [UnusedImport]
    /Users/andrea/progetti/emmy/tests/all.nim(18, 3) Warning: imported and not 
used: 'tnormal_forms' [UnusedImport]
    
    
    Run

I tried to locally disable the warning by thi small modification
    
    
    {. warning[UnusedImport]:off .}
    import tstructures, tpairs, toperations, ttableops, tmodular, tfractions,
      tpolynomials, tlinear, tprimality, tintegers_modulo, tfinite_fields,
      tnormal_forms
    {. warning[UnusedImport]:on .}
    
    
    Run

but apparently it has no effect. What is the correct incantation to persuade 
the compiler to not give warnings for these imports?

Reply via email to